From 6a77a2e96ba65e070226d0f707082a28f205bb71 Mon Sep 17 00:00:00 2001 From: Nicolas Agustin Guevara Pihen Date: Wed, 27 Nov 2024 14:40:29 -0300 Subject: [PATCH 1/4] Apply reference name change --- .../build_wazuh_dashboard_with_plugins.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 4992944ade24..897078dd83ca 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -117,10 +117,10 @@ jobs: PRODUCTION="" fi WAZUH_DASHBOARD_SLIM=wazuh-dashboard_${VERSION}-${REVISION}_x64.tar.gz - WAZUH_SECURITY_PLUGIN=wazuh-security-dashboards-plugin_${VERSION}-${REVISION}_${{ inputs.reference_security_plugins }}.zip - WAZUH_PLUGINS_WAZUH=wazuh-dashboard-plugins_wazuh_${VERSION}-${REVISION}_${{ inputs.reference_wazuh_plugins }}.zip - WAZUH_PLUGINS_CORE=wazuh-dashboard-plugins_wazuh-core_${VERSION}-${REVISION}_${{ inputs.reference_wazuh_plugins }}.zip - WAZUH_PLUGINS_CHECK_UPDATES=wazuh-dashboard-plugins_wazuh-check-updates_${VERSION}-${REVISION}_${{ inputs.reference_wazuh_plugins }}.zip + WAZUH_SECURITY_PLUGIN=wazuh-security-dashboards-plugin_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_security_plugins }} | sed 's/\//-/g').zip + WAZUH_PLUGINS_WAZUH=wazuh-dashboard-plugins_wazuh_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_wazuh_plugins }} | sed 's/\//-/g').zip + WAZUH_PLUGINS_CORE=wazuh-dashboard-plugins_wazuh-core_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_wazuh_plugins }} | sed 's/\//-/g').zip + WAZUH_PLUGINS_CHECK_UPDATES=wazuh-dashboard-plugins_wazuh-check-updates_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_wazuh_plugins }} | sed 's/\//-/g').zip if [ "${{ inputs.system }}" = "deb" ]; then if [ "${{ inputs.is_stage }}" = "true" ]; then PACKAGE_NAME=wazuh-dashboard_${VERSION}-${{ inputs.revision }}_${{ inputs.architecture }}.deb @@ -172,21 +172,21 @@ jobs: build-base: needs: [validate-job] name: Build dashboard - uses: wazuh/wazuh-dashboard/.github/workflows/build_base.yml@v4.10.0-beta1 + uses: wazuh/wazuh-dashboard/.github/workflows/build_base.yml@bug/430-unzip-command-not-found-in-package-generation-action with: CHECKOUT_TO: ${{ github.head_ref || github.ref_name }} build-main-plugins: needs: [validate-job] name: Build plugins - uses: wazuh/wazuh-dashboard-plugins/.github/workflows/manual-build.yml@v4.10.0-beta1 + uses: wazuh/wazuh-dashboard-plugins/.github/workflows/manual-build.yml@bug/430-unzip-command-not-found-in-package-generation-action with: reference: ${{ inputs.reference_wazuh_plugins }} build-security-plugin: needs: [validate-job] name: Build security plugin - uses: wazuh/wazuh-security-dashboards-plugin/.github/workflows/manual-build.yml@v4.10.0-beta1 + uses: wazuh/wazuh-security-dashboards-plugin/.github/workflows/manual-build.yml@bug/430-unzip-command-not-found-in-package-generation-action with: reference: ${{ inputs.reference_security_plugins }} From a0723bfb9e6c010672042bebfafd631a51b19d27 Mon Sep 17 00:00:00 2001 From: Nicolas Agustin Guevara Pihen Date: Wed, 27 Nov 2024 14:44:12 -0300 Subject: [PATCH 2/4] Add upload to github step --- .../build_wazuh_dashboard_with_plugins.yml | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 897078dd83ca..561a8a9e09fb 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -257,24 +257,31 @@ jobs: bash ./test-packages.sh \ -p ${{needs.setup-variables.outputs.PACKAGE_NAME}} - - name: Set up AWS CLI - uses: aws-actions/configure-aws-credentials@v4 + - uses: actions/upload-artifact@v3 + if: success() with: - aws-access-key-id: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_ACCESS_KEY }} - aws-secret-access-key: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_SECRET_KEY }} - aws-region: ${{ secrets.CI_AWS_REGION }} + name: ${{ needs.setup-variables.outputs.PACKAGE_NAME }} + path: ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ needs.setup-variables.outputs.PACKAGE_NAME }} + retention-days: 30 - - name: Upload package - run: | - echo "Uploading package" - aws s3 cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ inputs.system }}/${{needs.setup-variables.outputs.PACKAGE_NAME}} s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/ - s3uri="s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/${{needs.setup-variables.outputs.PACKAGE_NAME}}" - echo "S3 URI: ${s3uri}" + # - name: Set up AWS CLI + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # aws-access-key-id: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_ACCESS_KEY }} + # aws-secret-access-key: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_SECRET_KEY }} + # aws-region: ${{ secrets.CI_AWS_REGION }} - - name: Upload SHA512 - if: ${{ inputs.checksum }} - run: | - echo "Uploading checksum" - aws s3 cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ inputs.system }}/${{needs.setup-variables.outputs.PACKAGE_NAME}}.sha512 s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/ - s3uri="s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/${{needs.setup-variables.outputs.PACKAGE_NAME}}.sha512" - echo "S3 sha512 URI: ${s3uri}" + # - name: Upload package + # run: | + # echo "Uploading package" + # aws s3 cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ inputs.system }}/${{needs.setup-variables.outputs.PACKAGE_NAME}} s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/ + # s3uri="s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/${{needs.setup-variables.outputs.PACKAGE_NAME}}" + # echo "S3 URI: ${s3uri}" + + # - name: Upload SHA512 + # if: ${{ inputs.checksum }} + # run: | + # echo "Uploading checksum" + # aws s3 cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ inputs.system }}/${{needs.setup-variables.outputs.PACKAGE_NAME}}.sha512 s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/ + # s3uri="s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/${{needs.setup-variables.outputs.PACKAGE_NAME}}.sha512" + # echo "S3 sha512 URI: ${s3uri}" From 736529f221a9d2e8ebc5286be3a20158a42edac5 Mon Sep 17 00:00:00 2001 From: Nicolas Agustin Guevara Pihen Date: Wed, 27 Nov 2024 15:13:00 -0300 Subject: [PATCH 3/4] Fix artifact name --- .github/workflows/build_wazuh_dashboard_with_plugins.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 561a8a9e09fb..769dd8f2fa65 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -216,17 +216,17 @@ jobs: name: ${{ needs.setup-variables.outputs.WAZUH_SECURITY_PLUGIN }} path: ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/security-plugin - - name: Download plugins artifacts + - name: Download main plugin's artifact uses: actions/download-artifact@v4 with: name: ${{ needs.setup-variables.outputs.WAZUH_PLUGINS_WAZUH }} path: ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/plugins - - name: Download plugins artifacts + - name: Download core plugin's artifact uses: actions/download-artifact@v4 with: name: ${{ needs.setup-variables.outputs.WAZUH_PLUGINS_CORE }} path: ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/plugins - - name: Download plugins artifacts + - name: Download check update plugin's artifact uses: actions/download-artifact@v4 with: name: ${{ needs.setup-variables.outputs.WAZUH_PLUGINS_CHECK_UPDATES }} @@ -261,7 +261,7 @@ jobs: if: success() with: name: ${{ needs.setup-variables.outputs.PACKAGE_NAME }} - path: ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ needs.setup-variables.outputs.PACKAGE_NAME }} + path: ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ inputs.system }}/${{ needs.setup-variables.outputs.PACKAGE_NAME }} retention-days: 30 # - name: Set up AWS CLI From 6ac902dfdce0f0a6f6afa468bc5632017ca98ac1 Mon Sep 17 00:00:00 2001 From: Nicolas Agustin Guevara Pihen Date: Wed, 27 Nov 2024 15:39:33 -0300 Subject: [PATCH 4/4] Restore references to branches --- .../build_wazuh_dashboard_with_plugins.yml | 49 ++++++++----------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 769dd8f2fa65..2766317d404d 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -172,21 +172,21 @@ jobs: build-base: needs: [validate-job] name: Build dashboard - uses: wazuh/wazuh-dashboard/.github/workflows/build_base.yml@bug/430-unzip-command-not-found-in-package-generation-action + uses: wazuh/wazuh-dashboard/.github/workflows/build_base.yml@v4.10.0-beta1 with: CHECKOUT_TO: ${{ github.head_ref || github.ref_name }} build-main-plugins: needs: [validate-job] name: Build plugins - uses: wazuh/wazuh-dashboard-plugins/.github/workflows/manual-build.yml@bug/430-unzip-command-not-found-in-package-generation-action + uses: wazuh/wazuh-dashboard-plugins/.github/workflows/manual-build.yml@v4.10.0-beta1 with: reference: ${{ inputs.reference_wazuh_plugins }} build-security-plugin: needs: [validate-job] name: Build security plugin - uses: wazuh/wazuh-security-dashboards-plugin/.github/workflows/manual-build.yml@bug/430-unzip-command-not-found-in-package-generation-action + uses: wazuh/wazuh-security-dashboards-plugin/.github/workflows/manual-build.yml@v4.10.0-beta1 with: reference: ${{ inputs.reference_security_plugins }} @@ -257,31 +257,24 @@ jobs: bash ./test-packages.sh \ -p ${{needs.setup-variables.outputs.PACKAGE_NAME}} - - uses: actions/upload-artifact@v3 - if: success() + - name: Set up AWS CLI + uses: aws-actions/configure-aws-credentials@v4 with: - name: ${{ needs.setup-variables.outputs.PACKAGE_NAME }} - path: ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ inputs.system }}/${{ needs.setup-variables.outputs.PACKAGE_NAME }} - retention-days: 30 - - # - name: Set up AWS CLI - # uses: aws-actions/configure-aws-credentials@v4 - # with: - # aws-access-key-id: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_ACCESS_KEY }} - # aws-secret-access-key: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_SECRET_KEY }} - # aws-region: ${{ secrets.CI_AWS_REGION }} + aws-access-key-id: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_ACCESS_KEY }} + aws-secret-access-key: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_SECRET_KEY }} + aws-region: ${{ secrets.CI_AWS_REGION }} - # - name: Upload package - # run: | - # echo "Uploading package" - # aws s3 cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ inputs.system }}/${{needs.setup-variables.outputs.PACKAGE_NAME}} s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/ - # s3uri="s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/${{needs.setup-variables.outputs.PACKAGE_NAME}}" - # echo "S3 URI: ${s3uri}" + - name: Upload package + run: | + echo "Uploading package" + aws s3 cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ inputs.system }}/${{needs.setup-variables.outputs.PACKAGE_NAME}} s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/ + s3uri="s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/${{needs.setup-variables.outputs.PACKAGE_NAME}}" + echo "S3 URI: ${s3uri}" - # - name: Upload SHA512 - # if: ${{ inputs.checksum }} - # run: | - # echo "Uploading checksum" - # aws s3 cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ inputs.system }}/${{needs.setup-variables.outputs.PACKAGE_NAME}}.sha512 s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/ - # s3uri="s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/${{needs.setup-variables.outputs.PACKAGE_NAME}}.sha512" - # echo "S3 sha512 URI: ${s3uri}" + - name: Upload SHA512 + if: ${{ inputs.checksum }} + run: | + echo "Uploading checksum" + aws s3 cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ inputs.system }}/${{needs.setup-variables.outputs.PACKAGE_NAME}}.sha512 s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/ + s3uri="s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/${{needs.setup-variables.outputs.PACKAGE_NAME}}.sha512" + echo "S3 sha512 URI: ${s3uri}"