|
| 1 | +# This is a basic workflow that is manually triggered |
| 2 | +# @deprecated Official Wazuh images must be used instead: https://hub.docker.com/r/wazuh/wazuh |
| 3 | + |
| 4 | +name: Manual workflow build and push docker image |
| 5 | + |
| 6 | +# Controls when the action will run. Workflow runs when manually triggered using the UI |
| 7 | +# or API. |
| 8 | +on: |
| 9 | + workflow_dispatch: |
| 10 | + # Inputs the workflow accepts. |
| 11 | + inputs: |
| 12 | + build-manager-image: |
| 13 | + type: boolean |
| 14 | + description: 'Build manager image' |
| 15 | + required: false |
| 16 | + wazuh-manager-version: |
| 17 | + description: 'Wazuh manager version' |
| 18 | + default: 'v4.3.8' |
| 19 | + required: false |
| 20 | + elastic-manager-version: |
| 21 | + description: 'Elastic manager version' |
| 22 | + default: '7.17.0' |
| 23 | + required: false |
| 24 | + |
| 25 | + build-agent-image: |
| 26 | + type: boolean |
| 27 | + description: 'Build agent image' |
| 28 | + required: false |
| 29 | + wazuh-agent-version: |
| 30 | + description: 'Wazuh agent version' |
| 31 | + default: 'v4.3.8' |
| 32 | + required: false |
| 33 | + elastic-agent-version: |
| 34 | + description: 'Elastic manager version' |
| 35 | + default: '7.17.0' |
| 36 | + required: false |
| 37 | + |
| 38 | + build-cypress-image: |
| 39 | + type: boolean |
| 40 | + description: 'Build cypress image' |
| 41 | + required: false |
| 42 | + ubuntu-cypress-branch: |
| 43 | + description: 'Ubuntu cypress branch: Branch in which the image will be created, this branch must correspond to the wazuh-kibana-app project. It will take the tests written in the wazuh-kibana-app/test/cypress directory.' |
| 44 | + default: 'main' |
| 45 | + required: false |
| 46 | + image-cypress-version: |
| 47 | + description: 'Image cypress version' |
| 48 | + default: '3.0.0' |
| 49 | + required: false |
| 50 | + |
| 51 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 52 | +jobs: |
| 53 | + job-build-manager-image: |
| 54 | + if: ${{ github.event.inputs.build-manager-image == 'true' }} |
| 55 | + name: Run build and push manager image |
| 56 | + runs-on: ubuntu-latest |
| 57 | + steps: |
| 58 | + - name: Step 01 - Download wazuh-kibana-app |
| 59 | + uses: actions/checkout@v2 |
| 60 | + with: |
| 61 | + path: wazuh-kibana-app |
| 62 | + - name: Step 02 - Login to quay.io |
| 63 | + run: | |
| 64 | + docker login -u=${{ secrets.QUAYIO_USERNAME }} -p=${{ secrets.QUAYIO_TOKEN }} quay.io |
| 65 | + - name: Step 03 - Build image |
| 66 | + run: | |
| 67 | + cd ${{ github.workspace }}/wazuh-kibana-app/test/cypress/images/wazuh_manager_filebeat_sources_cmake |
| 68 | + docker build -t quay.io/wazuh/wazuh-manager-image:${{ github.event.inputs.wazuh-manager-version }}-${{ github.event.inputs.elastic-manager-version }} \ |
| 69 | + --build-arg WAZUH_VERSION=${{ github.event.inputs.wazuh-manager-version }} \ |
| 70 | + --build-arg FILEBEAT_VERSION=${{ github.event.inputs.elastic-manager-version }} \ |
| 71 | + --build-arg FILEBEAT_WAZUH_TEMPLATE_URL=https://raw.githubusercontent.com/wazuh/wazuh/4.0/extensions/elasticsearch/7.x/wazuh-template.json \ |
| 72 | + --build-arg FILEBEAT_WAZUH_MODULE_URL=https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.1.tar.gz . |
| 73 | + - name: Step 04 - Push image to quay.io |
| 74 | + run: | |
| 75 | + docker push quay.io/wazuh/wazuh-manager-image:${{ github.event.inputs.wazuh-manager-version }}-${{ github.event.inputs.elastic-manager-version }} |
| 76 | +
|
| 77 | + job-build-agent-image: |
| 78 | + if: ${{ github.event.inputs.build-agent-image == 'true' }} |
| 79 | + name: Run build and push agent image |
| 80 | + runs-on: ubuntu-latest |
| 81 | + steps: |
| 82 | + - name: Step 01 - Download wazuh-kibana-app |
| 83 | + uses: actions/checkout@v2 |
| 84 | + with: |
| 85 | + path: wazuh-kibana-app |
| 86 | + - name: Step 02 - Login to quay.io |
| 87 | + run: | |
| 88 | + docker login -u=${{ secrets.QUAYIO_USERNAME }} -p=${{ secrets.QUAYIO_TOKEN }} quay.io |
| 89 | + - name: Step 03 - Build image |
| 90 | + run: | |
| 91 | + cd ${{ github.workspace }}/wazuh-kibana-app/test/cypress/images/wazuh_agent_ubuntu_sources_cmake |
| 92 | + docker build -t quay.io/wazuh/wazuh-agent-image:${{ github.event.inputs.wazuh-agent-version }} \ |
| 93 | + --build-arg WAZUH_VERSION=${{ github.event.inputs.wazuh-agent-version }} . |
| 94 | + - name: Step 04 - Push image to quay.io |
| 95 | + run: | |
| 96 | + docker push quay.io/wazuh/wazuh-agent-image:${{ github.event.inputs.wazuh-agent-version }} |
| 97 | +
|
| 98 | + job-build-cypress-image: |
| 99 | + if: ${{ github.event.inputs.build-cypress-image == 'true' }} |
| 100 | + name: Run build and push cypress image |
| 101 | + runs-on: ubuntu-latest |
| 102 | + steps: |
| 103 | + - name: Step 01 - Download wazuh-kibana-app |
| 104 | + uses: actions/checkout@v2 |
| 105 | + with: |
| 106 | + path: wazuh-kibana-app |
| 107 | + - name: Step 02 - Login to quay.io |
| 108 | + run: | |
| 109 | + docker login -u=${{ secrets.QUAYIO_USERNAME }} -p=${{ secrets.QUAYIO_TOKEN }} quay.io |
| 110 | + - name: Step 03 - Build image |
| 111 | + run: | |
| 112 | + cd ${{ github.workspace }}/wazuh-kibana-app/test/cypress/images/ubuntu-cypress |
| 113 | + docker build -t quay.io/wazuh/wazuh-ubuntu-cypress:${{ github.event.inputs.image-cypress-version }} \ |
| 114 | + --build-arg UBUNTU_CYPRESS_BRANCH=${{ github.event.inputs.ubuntu-cypress-branch }} . |
| 115 | + - name: Step 04 - Push image to quay.io |
| 116 | + run: | |
| 117 | + docker push quay.io/wazuh/wazuh-ubuntu-cypress:${{ github.event.inputs.image-cypress-version }} |
0 commit comments