Skip to content

Commit

Permalink
Add repository choise in offline-installation workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Enaraque committed Dec 17, 2024
1 parent 2257a79 commit 60debef
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/actions/offline-installation/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function dashboard_installation() {
function download_resources() {

check_file "${ABSOLUTE_PATH}"/wazuh-install.sh
bash "${ABSOLUTE_PATH}"/wazuh-install.sh -dw "${sys_type}"
bash "${ABSOLUTE_PATH}"/wazuh-install.sh -dw "${sys_type}" -d "${1}"
echo "INFO: Downloading the resources..."

curl -sO https://packages.wazuh.com/4.10/config.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ABSOLUTE_PATH="$( cd $(dirname ${0}) ; pwd -P )"

check_system
install_dependencies
download_resources
download_resources $1

indexer_installation
echo "INFO: Wazuh indexer installation completed."
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/offline-installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ on:
description: "Branch or tag of the wazuh-installation-assistant repository."
required: true
default: 4.10.2
REPOSITORY:
description: "Repository to use for the installation."
type: choice
options:
- "pre-release"
- "stable"
required: true
default: "pre-release"

env:
REPOSITORY: ${{ github.event_name == 'pull_request' && 'pre-release' || inputs.REPOSITORY }}

jobs:
Build-wazuh-install-script:
Expand Down Expand Up @@ -51,7 +62,7 @@ jobs:
run: cp $GITHUB_WORKSPACE/wazuh-install.sh $GITHUB_WORKSPACE/.github/actions/offline-installation/wazuh-install.sh

- name: Run script
run: sudo bash $GITHUB_WORKSPACE/.github/actions/offline-installation/offline-installation.sh
run: sudo bash $GITHUB_WORKSPACE/.github/actions/offline-installation/offline-installation.sh ${{ env.REPOSITORY}}

Test-offline-installation-rpm:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion install_functions/wazuh-offline-download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# and/or modify it under the terms of the GNU General Public
# License (version 2) as published by the FSF - Free Software
# Foundation.

function offline_download() {

common_logger "Starting Wazuh packages download."
Expand Down

0 comments on commit 60debef

Please sign in to comment.