diff --git a/dev-tools/build-packages/base/generate_base.sh b/dev-tools/build-packages/base/generate_base.sh index 20f1385638c3..ad59dc776bbb 100755 --- a/dev-tools/build-packages/base/generate_base.sh +++ b/dev-tools/build-packages/base/generate_base.sh @@ -76,7 +76,6 @@ build() { echo echo "Downloading dashboards..." echo - if [[ $base =~ $valid_url ]]; then if [[ $base =~ .*\.zip ]]; then if ! curl --output wazuh-dashboard.zip --silent --fail "${base}"; then @@ -118,7 +117,7 @@ build() { fi tar -zxf wazuh-dashboard.tar.gz - directory_name=$(ls -t | head -1) + directory_name=$(ls -td */ | head -1) working_dir="wazuh-dashboard-$version-$revision-linux-x64" mv $directory_name $working_dir cd $working_dir @@ -129,7 +128,7 @@ build() { # Install Wazuh apps and Security app - plugins=$(ls $tmp_dir/applications)' '$(cat ../../plugins) + plugins=$(ls $tmp_dir/applications)' '$(cat $current_path/plugins) for plugin in $plugins; do if [[ $plugin =~ .*\.zip ]]; then install='file:../applications/'$plugin diff --git a/dev-tools/build-packages/deb/launcher.sh b/dev-tools/build-packages/deb/launcher.sh index 2eb463d1139e..dcab4b3653f0 100755 --- a/dev-tools/build-packages/deb/launcher.sh +++ b/dev-tools/build-packages/deb/launcher.sh @@ -82,7 +82,7 @@ build_deb() { # Prepare the package tar -zxf wazuh-dashboard.tar.gz - directory_name=$(ls -t | head -1) + directory_name=$(ls -td */ | head -1) rm wazuh-dashboard.tar.gz mv $directory_name wazuh-dashboard-base jq '.wazuh.revision="'${revision}'"' wazuh-dashboard-base/package.json > pkgtmp.json && mv pkgtmp.json wazuh-dashboard-base/package.json @@ -97,11 +97,11 @@ build_deb() { if [[ ${build_docker} == "yes" ]]; then docker build -t ${container_name} ${dockerfile_path} || return 1 fi - # Build the Debian package with a Docker container if [ ! -d "$out_dir" ]; then mkdir -p $out_dir fi + volumes="-v ${out_dir}/:/tmp:Z -v ${tmp_dir}/wazuh-dashboard.tar.gz:/opt/wazuh-dashboard.tar.gz" docker run -t --rm ${volumes} \ -v ${current_path}/../..:/root:Z \ diff --git a/dev-tools/build-packages/rpm/launcher.sh b/dev-tools/build-packages/rpm/launcher.sh index 0cd7fb16559e..9695f9e8c4df 100755 --- a/dev-tools/build-packages/rpm/launcher.sh +++ b/dev-tools/build-packages/rpm/launcher.sh @@ -83,7 +83,7 @@ build_rpm() { # Prepare the package tar -zxf wazuh-dashboard.tar.gz - directory_name=$(ls -t | head -1) + directory_name=$(ls -td */ | head -1) rm wazuh-dashboard.tar.gz mv $directory_name wazuh-dashboard-base jq '.wazuh.revision="'${revision}'"' wazuh-dashboard-base/package.json > pkgtmp.json && mv pkgtmp.json wazuh-dashboard-base/package.json