Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update future version on wazuh-control script #2410

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion alpine/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ help() {
echo -e " [Optional] Use the SPECS files stored in the host instead of downloading them from GitHub."
echo -e ""
echo -e " --future"
echo -e " [Optional] Build test future package 99.99.0 Used for development purposes."
echo -e " [Optional] Build test future package {MAJOR}.30.0 Used for development purposes."
echo -e ""
echo -e " -h, --help"
echo -e " Show this help."
Expand Down
7 changes: 6 additions & 1 deletion alpine/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ fi
export version="$(cat wazuh*/src/VERSION | cut -d 'v' -f 2)"

if [ "${future}" = "yes" ]; then
export version="99.99.0"
old_version=$version
MAJOR=$(echo $version | cut -dv -f2 | cut -d. -f1)
export version="${MAJOR}.30.0"
sed -i "s/${old_version}/${version}/g" "/wazuh"*"/src/init/wazuh-server.sh"
sed -i "s/${old_version}/${version}/g" "/wazuh"*"/src/init/wazuh-client.sh"
sed -i "s/${old_version}/${version}/g" "/wazuh"*"/src/init/wazuh-local.sh"
fi


Expand Down
5 changes: 4 additions & 1 deletion arch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if [[ "${future}" == "yes" ]]; then
base_version=${wazuh_version}
MAJOR=$(echo ${base_version} | cut -dv -f2 | cut -d. -f1)
MINOR=$(echo ${base_version} | cut -d. -f2)
wazuh_version="99.99.0"
wazuh_version="${MAJOR}.30.0"
package_full_name=wazuh-${build_target}-${wazuh_version}

# PREPARE FUTURE SPECS AND SOURCES
Expand All @@ -70,6 +70,9 @@ if [[ "${future}" == "yes" ]]; then
sources_dir="${tmp_sources_dir}"
find "${sources_dir}" "${specs_path}" \( -name "*VERSION*" -o -name "*changelog*" \) -exec sed -i "s/${base_version}/${wazuh_version}/g" {} \;
sed -i "s/\$(VERSION)/${MAJOR}.${MINOR}/g" "${sources_dir}/src/Makefile"
sed -i "s/${base_version}/${wazuh_version}/g" "${sources_dir}/src/init/wazuh-server.sh"
sed -i "s/${base_version}/${wazuh_version}/g" "${sources_dir}/src/init/wazuh-client.sh"
sed -i "s/${base_version}/${wazuh_version}/g" "${sources_dir}/src/init/wazuh-local.sh"
fi

cd ${sources_dir} && tar -czf ${pacman_dir}/${package_full_name}.tar.gz .
Expand Down
2 changes: 1 addition & 1 deletion arch/generate_arch_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ help() {
echo " --sources <path> [Optional] Absolute path containing wazuh source code. This option will use local source code instead of downloading it from GitHub."
echo " --packages-branch <branch> [Required] Select Git branch or tag from wazuh-packages repository. e.g ${PACKAGES_BRANCH}"
echo " --dev [Optional] Use the SPECS files stored in the host instead of downloading them from GitHub."
echo " --future [Optional] Build test future package 99.99.0 Used for development purposes."
echo " --future [Optional] Build test future package {MAJOR}.30.0 Used for development purposes."
echo " -h, --help Show this help."
echo
exit $1
Expand Down
4 changes: 3 additions & 1 deletion debs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ if [[ "${future}" == "yes" ]]; then
# PREPARE FUTURE SPECS AND SOURCES
find "${build_dir}/${package_name}" "${specs_path}" \( -name "*VERSION*" -o -name "*changelog*" \) -exec sed -i "s/${base_version}/${wazuh_version}/g" {} \;
sed -i "s/\$(VERSION)/${MAJOR}.${MINOR}/g" "${build_dir}/${build_target}/${package_full_name}/src/Makefile"
sed -i "s/${base_version}/${wazuh_version}/g" "${build_dir}/${build_target}/${package_full_name}/src/init/wazuh-server.sh"
sed -i "s/${base_version}/${wazuh_version}/g" "${build_dir}/${build_target}/${package_full_name}/src/init/wazuh-client.sh"
sed -i "s/${base_version}/${wazuh_version}/g" "${build_dir}/${build_target}/${package_full_name}/src/init/wazuh-local.sh"
fi
cp -pr ${specs_path}/wazuh-${build_target}/debian ${sources_dir}/debian
cp -p ${package_files}/gen_permissions.sh ${sources_dir}
Expand Down Expand Up @@ -125,4 +128,3 @@ if [[ "${checksum}" == "yes" ]]; then
cd ${pkg_path} && sha512sum ${deb_file} > /var/local/checksum/${deb_file}.sha512
fi
mv ${pkg_path}/${deb_file} /var/local/wazuh

7 changes: 4 additions & 3 deletions rpms/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ else
specs_path="/specs"
fi

if [[ "${future}" == "yes" ]]; then
if [[ "${future}" == "yes" ]]; then
# MODIFY VARIABLES
base_version=$wazuh_version
MAJOR=$(echo $base_version | cut -dv -f2 | cut -d. -f1)
Expand All @@ -88,7 +88,9 @@ if [[ "${future}" == "yes" ]]; then
mv "${build_dir}/${old_package_name}" "${build_dir}/${package_name}"
find "${build_dir}/${package_name}" "${specs_path}/" \( -name "*VERSION*" -o -name "*.spec" \) -exec sed -i "s/${base_version}/${wazuh_version}/g" {} \;
sed -i "s/\$(VERSION)/${MAJOR}.${MINOR}/g" "${build_dir}/${package_name}/src/Makefile"

sed -i "s/${base_version}/${wazuh_version}/g" "${build_dir}/${package_name}/src/init/wazuh-server.sh"
sed -i "s/${base_version}/${wazuh_version}/g" "${build_dir}/${package_name}/src/init/wazuh-client.sh"
sed -i "s/${base_version}/${wazuh_version}/g" "${build_dir}/${package_name}/src/init/wazuh-local.sh"
fi

cp ${specs_path}/wazuh-${build_target}.spec ${rpm_build_dir}/SPECS/${package_name}.spec
Expand Down Expand Up @@ -129,4 +131,3 @@ if [[ "${src}" == "yes" ]]; then
fi

find ${extract_path} -maxdepth 3 -type f -name "${file_name}*" -exec mv {} /var/local/wazuh \;

Loading