From 7d3e3d1801a44fdff8cd25a866cc51da2c2f0e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Mon, 16 Sep 2024 11:12:11 +0200 Subject: [PATCH] Include Command Manager plugin to the build workflow (#408) * Include Command Manager plugin to the build workflow * Remove 'github.event.' * Remove double slash * Update artifact path --- .github/workflows/build.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a941964cbec6..3a44cd3edc045 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,24 +103,24 @@ jobs: - id: setup run: | matrix=$(jq -cn \ - --argjson distribution '${{ github.event.inputs.distribution }}' \ - --argjson architecture '${{ github.event.inputs.architecture }}' \ + --argjson distribution '${{ inputs.distribution }}' \ + --argjson architecture '${{ inputs.architecture }}' \ '{distribution: $distribution, architecture: $architecture}' ) echo "matrix=$matrix" >> $GITHUB_OUTPUT build-plugins: - if: ${{ github.event.inputs.plugins_reference != '' }} + if: ${{ inputs.plugins_reference != '' }} strategy: fail-fast: false matrix: - plugins: ["wazuh-indexer-setup"] + plugins: ["setup", "command-manager"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: repository: wazuh/wazuh-indexer-plugins - ref: ${{ github.event.inputs.plugins_reference }} + ref: ${{ inputs.plugins_reference }} - uses: actions/setup-java@v4 with: distribution: temurin @@ -134,16 +134,16 @@ jobs: run: echo "version=$(> "$GITHUB_OUTPUT" - name: Build with Gradle - working-directory: .//plugins/${{ matrix.plugins }} + working-directory: ./plugins/${{ matrix.plugins }} run: | - ./gradlew build -Dversion=${{ steps.version.outputs.version }} -Drevision=${{ github.event.inputs.revision }} + ./gradlew build -Dversion=${{ steps.version.outputs.version }} -Drevision=${{ inputs.revision }} ls -lR build/distributions/ - name: Upload artifact uses: actions/upload-artifact@v4 with: name: ${{ matrix.plugins }} - path: "./plugins/${{ matrix.plugins }}/build/distributions/${{ matrix.plugins }}-${{ steps.version.outputs.version }}.${{ github.event.inputs.revision }}.zip" + path: "./plugins/${{ matrix.plugins }}/build/distributions/wazuh-indexer-${{ matrix.plugins }}-${{ steps.version.outputs.version }}.${{ inputs.revision }}.zip" if-no-files-found: error build: @@ -157,13 +157,13 @@ jobs: # Download plugins - uses: actions/download-artifact@v4 - if: ${{ github.event.inputs.plugins_reference != '' }} + if: ${{ inputs.plugins_reference != '' }} with: path: ./artifacts/plugins merge-multiple: true - name: Display structure of downloaded files - if: ${{ github.event.inputs.plugins_reference != '' }} + if: ${{ inputs.plugins_reference != '' }} run: ls -lR ./artifacts/plugins - uses: actions/setup-java@v4 @@ -184,8 +184,8 @@ jobs: name=$(bash build-scripts/baptizer.sh -m \ -a ${{ matrix.architecture }} \ -d ${{ matrix.distribution }} \ - -r ${{ github.event.inputs.revision }} \ - ${{ github.event.inputs.is_stage && '-x' || '' }} \ + -r ${{ inputs.revision }} \ + ${{ inputs.is_stage && '-x' || '' }} \ ) echo "name=$name" >> $GITHUB_OUTPUT id: min_package @@ -195,8 +195,8 @@ jobs: name=$(bash build-scripts/baptizer.sh \ -a ${{ matrix.architecture }} \ -d ${{ matrix.distribution }} \ - -r ${{ github.event.inputs.revision }} \ - ${{ github.event.inputs.is_stage && '-x' || '' }} \ + -r ${{ inputs.revision }} \ + ${{ inputs.is_stage && '-x' || '' }} \ ) echo "name=$name" >> $GITHUB_OUTPUT id: package @@ -213,7 +213,7 @@ jobs: bash build-scripts/assemble.sh \ -a ${{ matrix.architecture }} \ -d ${{ matrix.distribution }} \ - -r ${{ github.event.inputs.revision }} + -r ${{ inputs.revision }} - name: Test RPM package if: ${{ matrix.distribution == 'rpm' }} @@ -237,7 +237,7 @@ jobs: if-no-files-found: error - name: Set up AWS CLI - if: ${{ github.event.inputs.upload }} + if: ${{ inputs.upload }} uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_ACCESS_KEY }} @@ -245,7 +245,7 @@ jobs: aws-region: ${{ secrets.CI_AWS_REGION }} - name: Upload package to S3 - if: ${{ github.event.inputs.upload }} + if: ${{ inputs.upload }} run: | src="artifacts/dist/${{ steps.package.outputs.name }}" dest="s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/" @@ -254,7 +254,7 @@ jobs: echo "S3 URI: ${s3uri}" - name: Upload checksum to S3 - if: ${{ github.event.inputs.upload && github.event.inputs.checksum }} + if: ${{ inputs.upload && inputs.checksum }} run: | src="artifacts/dist/${{ steps.package.outputs.name }}.sha512" dest="s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/"