Skip to content

Commit

Permalink
Merge pull request #3098 from wazuh/bug/3092-wazuh-installation-assis…
Browse files Browse the repository at this point in the history
…tant-should-use-a-github-tag-instead-of-a-branch-in-the-release-tests-9.1

Change version to tag reference in source_branch references
  • Loading branch information
c-bordon authored Sep 11, 2024
2 parents 144747c + cfdca83 commit f1f03dd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions unattended_installer/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ readonly resources_certs="${base_path_builder}/cert_tool"
readonly resources_passwords="${base_path_builder}/passwords_tool"
readonly resources_common="${base_path_builder}/common_functions"
readonly resources_download="${base_path_builder}/downloader"
source_branch="4.9.1"
source_branch="v4.9.1"

function getHelp() {

Expand Down Expand Up @@ -48,8 +48,6 @@ function getHelp() {

function buildInstaller() {

checkDistDetectURL

output_script_path="${base_path_builder}/wazuh-install.sh"

## Create installer script
Expand All @@ -76,7 +74,10 @@ function buildInstaller() {
echo 'readonly filebeat_wazuh_module="${repobaseurl}/filebeat/wazuh-filebeat-0.4.tar.gz"' >> "${output_script_path}"
echo 'readonly bucket="packages-dev.wazuh.com"' >> "${output_script_path}"
echo 'readonly repository="'"${devrepo}"'"' >> "${output_script_path}"
sed -i 's|v${wazuh_version}|${wazuh_version}|g' "${resources_installer}/installVariables.sh"
if [[ ! $(grep -E "source_branch=" "${resources_installer}/installVariables.sh" | sed -E 's/.*source_branch="([^"]+)"/\1/') =~ "-" ]]; then
sed -i 's|v${wazuh_version}|${wazuh_version}|g' "${resources_installer}/installVariables.sh"
pre_release_tag=1
fi
else
echo 'readonly repogpg="https://packages.wazuh.com/key/GPG-KEY-WAZUH"' >> "${output_script_path}"
echo 'readonly repobaseurl="https://packages.wazuh.com/4.x"' >> "${output_script_path}"
Expand Down Expand Up @@ -117,6 +118,7 @@ function buildInstaller() {
done

## dist-detect.sh
checkDistDetectURL
echo "function dist_detect() {" >> "${output_script_path}"
curl -s "https://raw.githubusercontent.com/wazuh/wazuh/${source_branch}/src/init/dist-detect.sh" | sed '/^#/d' >> "${output_script_path}"
echo "}" >> "${output_script_path}"
Expand Down Expand Up @@ -265,7 +267,7 @@ function builder_main() {
if [ -n "${change_filebeat_url}" ]; then
sed -i -E "s|(https.+)master(.+wazuh-template.json)|\1\\$\\{source_branch\\}\2|" "${resources_installer}/installVariables.sh"
fi
if [ -n "${development}" ]; then
if [[ -n "${development}" && -n "${pre_release_tag}" ]]; then
sed -i 's|${wazuh_version}|v${wazuh_version}|g' "${resources_installer}/installVariables.sh"
fi
fi
Expand All @@ -284,7 +286,6 @@ function builder_main() {
function checkDistDetectURL() {

urls=("https://raw.githubusercontent.com/wazuh/wazuh/${source_branch}/src/init/dist-detect.sh"
"https://raw.githubusercontent.com/wazuh/wazuh/v${source_branch}/src/init/dist-detect.sh"
"https://raw.githubusercontent.com/wazuh/wazuh/master/src/init/dist-detect.sh")

for url in "${urls[@]}"; do
Expand Down

0 comments on commit f1f03dd

Please sign in to comment.