Skip to content

Commit

Permalink
Fix errors in package build workflow (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tostti authored Apr 19, 2024
1 parent eb8ca89 commit 6bca359
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions dev-tools/build-packages/base/generate_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions dev-tools/build-packages/deb/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
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 6bca359

Please sign in to comment.