Skip to content

Offline installation test #31

Offline installation test

Offline installation test #31

name: Offline installation test
on:
pull_request:
paths:
- 'install_functions/wazuh-offline-download.sh'
- 'install_functions/wazuh-offline-installation.sh'
workflow_dispatch:
inputs:
WAZUH_INSTALLATION_ASSISTANT_REFERENCE:
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"
- "staging"
required: true
default: "pre-release"
env:
WAZUH_VERSION: "4.10"
REPOSITORY: ${{ github.event_name == 'pull_request' && 'pre-release' || inputs.REPOSITORY }}
jobs:
Build-wazuh-install-script:
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: 'true'
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_after_successful_duplicate: 'false'
- uses: actions/checkout@v4
with:
ref: ${{ inputs.WAZUH_INSTALLATION_ASSISTANT_REFERENCE }}
- name: Build wazuh-install script and use staging packages
run: bash builder.sh -i
- uses: actions/upload-artifact@v3
with:
name: script
path: ./wazuh-install.sh
if-no-files-found: error
Test-offline-installation-debian:
runs-on: ubuntu-latest
needs: Build-wazuh-install-script
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.WAZUH_INSTALLATION_ASSISTANT_REFERENCE }}
- uses: actions/download-artifact@v3
with:
name: script
- name: Move installation assistant script
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 ${{ env.REPOSITORY}} ${{ env.WAZUH_VERSION }}
Test-offline-installation-rpm:
runs-on: ubuntu-latest
needs: Build-wazuh-install-script
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.WAZUH_INSTALLATION_ASSISTANT_REFERENCE }}
- uses: actions/download-artifact@v3
with:
name: script
- name: Move installation assistant script
run: cp $GITHUB_WORKSPACE/wazuh-install.sh $GITHUB_WORKSPACE/.github/actions/offline-installation/wazuh-install.sh
- name: Launch docker and run script
run: sudo docker run -v $GITHUB_WORKSPACE/.github/actions/offline-installation/:/tests centos:centos7 bash /tests/offline-installation.sh