Skip to content

Commit

Permalink
Fix problem in directory name obtention
Browse files Browse the repository at this point in the history
  • Loading branch information
Tostti committed Apr 18, 2024
1 parent 229a949 commit 83eed79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions dev-tools/build-packages/deb/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,27 +82,29 @@ 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
cp $config_path/* wazuh-dashboard-base
echo ${version} >wazuh-dashboard-base/VERSION
tar -czf ./wazuh-dashboard.tar.gz wazuh-dashboard-base

ls ${current_path}
# Copy the necessary files
cp ${current_path}/builder.sh ${dockerfile_path}

# Build the Docker image
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"
echo $volumes
docker run -t --rm ${volumes} \
-v ${current_path}/../..:/root:Z \
${container_name} ${architecture} \
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/build-packages/rpm/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 83eed79

Please sign in to comment.