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

Fix errors in package build workflow #169

Merged
merged 4 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
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
5 changes: 3 additions & 2 deletions dev-tools/build-packages/deb/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,27 @@ 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}
Tostti marked this conversation as resolved.
Show resolved Hide resolved
# 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"
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
Loading