From d6e437dc1b4aacdcb672ab6c1687df556184c158 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Mon, 9 Dec 2024 15:53:37 -0300 Subject: [PATCH 01/13] Update WAZUH_DASHBOARD_SLIM filename based on architecture in build workflow (#403) --- .github/workflows/build_wazuh_dashboard_with_plugins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 6dd86ea5d4ff..98fbe4538ec1 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -116,7 +116,7 @@ jobs: else PRODUCTION="" fi - WAZUH_DASHBOARD_SLIM=wazuh-dashboard_${VERSION}-${REVISION}_x64.tar.gz + WAZUH_DASHBOARD_SLIM=wazuh-dashboard_${VERSION}-${REVISION}_${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'x64' || 'arm64' }}.tar.gz WAZUH_SECURITY_PLUGIN=wazuh-security-dashboards-plugin_${VERSION}-${REVISION}_${{ inputs.reference_security_plugins }}.zip WAZUH_PLUGINS=wazuh-dashboard-plugins_${VERSION}-${REVISION}_${{ inputs.reference_wazuh_plugins }}.zip if [ "${{ inputs.system }}" = "deb" ]; then From 9b0ca4124ea13e16f1766e4829b972e405a97f69 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Mon, 9 Dec 2024 15:53:53 -0300 Subject: [PATCH 02/13] Comment out AWS CLI setup and package verification steps in the build workflow for Wazuh Dashboard with plugins --- .../build_wazuh_dashboard_with_plugins.yml | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 98fbe4538ec1..0d109617f1b6 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -158,24 +158,24 @@ jobs: exit 1 fi - - 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: 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: Verify if package is already built - run: | - set +e - echo "Verifying package" - PACKAGE_NAME=${{ needs.setup-variables.outputs.PACKAGE_NAME }} - exists=$(aws s3 ls s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/$PACKAGE_NAME) - if [ -n "$exists" ]; then - echo "Package already exists" - exit 1 - fi - set -e + # - name: Verify if package is already built + # run: | + # set +e + # echo "Verifying package" + # PACKAGE_NAME=${{ needs.setup-variables.outputs.PACKAGE_NAME }} + # exists=$(aws s3 ls s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/$PACKAGE_NAME) + # if [ -n "$exists" ]; then + # echo "Package already exists" + # exit 1 + # fi + # set -e build-base: needs: [validate-job] @@ -256,24 +256,24 @@ jobs: bash ./test-packages.sh \ -p ${{needs.setup-variables.outputs.PACKAGE_NAME}} - - 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: 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 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}" From 506dd39a9f766726c57c250d842024bceb406154 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Mon, 9 Dec 2024 16:55:49 -0300 Subject: [PATCH 03/13] Fix copy command in build workflow to remove unnecessary 'ls' command for Wazuh Dashboard package testing --- .github/workflows/build_wazuh_dashboard_with_plugins.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 0d109617f1b6..0c53ffec1577 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -251,8 +251,7 @@ jobs: - name: Test package run: | cd ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/test-packages - ls -la ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ inputs.system }} - cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{ inputs.system }}/${{needs.setup-variables.outputs.PACKAGE_NAME}} ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/test-packages/${{ inputs.system }} + cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{needs.setup-variables.outputs.PACKAGE_NAME}} ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/test-packages/${{ inputs.system }} bash ./test-packages.sh \ -p ${{needs.setup-variables.outputs.PACKAGE_NAME}} From ca6ff8993d3a17f770c82f4c4f296b1cb21b14d6 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Mon, 9 Dec 2024 17:42:57 -0300 Subject: [PATCH 04/13] Add debugging 'ls' command to check dev-tools directory in Wazuh Dashboard build workflow before testing package --- .github/workflows/build_wazuh_dashboard_with_plugins.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 0c53ffec1577..2f9caf508530 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -251,6 +251,7 @@ jobs: - name: Test package run: | cd ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/test-packages + ls -laR ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{needs.setup-variables.outputs.PACKAGE_NAME}} ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/test-packages/${{ inputs.system }} bash ./test-packages.sh \ -p ${{needs.setup-variables.outputs.PACKAGE_NAME}} From 5e283376c39d6ae782383e709e18c37e4914f2c5 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Tue, 10 Dec 2024 09:02:56 -0300 Subject: [PATCH 05/13] Update 'ls' command in build workflow to point to the correct output directory for Wazuh Dashboard package testing --- .github/workflows/build_wazuh_dashboard_with_plugins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 2f9caf508530..0a295af897cf 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -251,7 +251,7 @@ jobs: - name: Test package run: | cd ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/test-packages - ls -laR ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools + ls -laR ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{needs.setup-variables.outputs.PACKAGE_NAME}} ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/test-packages/${{ inputs.system }} bash ./test-packages.sh \ -p ${{needs.setup-variables.outputs.PACKAGE_NAME}} From 6e9ada427f4a673aba3c2868a297072024438268 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Tue, 10 Dec 2024 09:03:04 -0300 Subject: [PATCH 06/13] Add support for aarch64 architecture option in build-packages script for improved cross-platform compatibility --- dev-tools/build-packages/build-packages.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dev-tools/build-packages/build-packages.sh b/dev-tools/build-packages/build-packages.sh index 71100a6429af..2622c4c75f50 100755 --- a/dev-tools/build-packages/build-packages.sh +++ b/dev-tools/build-packages/build-packages.sh @@ -170,6 +170,7 @@ help() { echo " --tar Build for tar." echo " --production [Optional] The naming of the package will be ready for production." echo " --arm [Optional] Build for arm64 instead of x64." + echo " --aarch64 [Optional] Build for aarch64 instead of x86_64." echo " --debug [Optional] Debug mode." echo " --silent [Optional] Silent mode. Will not work if --debug is set." echo " -r, --revision [Optional] Set the revision of this build. By default, it is set to 1." @@ -248,6 +249,10 @@ main() { architecture="arm64" shift 1 ;; + "--aarch64") + architecture="aarch64" + shift 1 + ;; "--silent") verbose="silent" shift 1 From 01906e34617f33c14ba661576a7d7acd1c030f18 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Tue, 10 Dec 2024 09:59:48 -0300 Subject: [PATCH 07/13] Remove aarch64 option from build-packages script, streamlining architecture support for clearer cross-platform building --- dev-tools/build-packages/build-packages.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dev-tools/build-packages/build-packages.sh b/dev-tools/build-packages/build-packages.sh index 2622c4c75f50..71100a6429af 100755 --- a/dev-tools/build-packages/build-packages.sh +++ b/dev-tools/build-packages/build-packages.sh @@ -170,7 +170,6 @@ help() { echo " --tar Build for tar." echo " --production [Optional] The naming of the package will be ready for production." echo " --arm [Optional] Build for arm64 instead of x64." - echo " --aarch64 [Optional] Build for aarch64 instead of x86_64." echo " --debug [Optional] Debug mode." echo " --silent [Optional] Silent mode. Will not work if --debug is set." echo " -r, --revision [Optional] Set the revision of this build. By default, it is set to 1." @@ -249,10 +248,6 @@ main() { architecture="arm64" shift 1 ;; - "--aarch64") - architecture="aarch64" - shift 1 - ;; "--silent") verbose="silent" shift 1 From e6f94ec69d37030c12c0ea298eed1b2e83151179 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Tue, 10 Dec 2024 09:59:54 -0300 Subject: [PATCH 08/13] Enhance build workflow by including ARCHITECTURE_FLAG for handling architecture in package builds and outputs --- .../build_wazuh_dashboard_with_plugins.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 0a295af897cf..13d76ce54e0b 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -100,6 +100,7 @@ jobs: WAZUH_SECURITY_PLUGIN: ${{ steps.setup-variables.outputs.WAZUH_SECURITY_PLUGIN }} WAZUH_PLUGINS: ${{ steps.setup-variables.outputs.WAZUH_PLUGINS }} PACKAGE_NAME: ${{ steps.setup-variables.outputs.PACKAGE_NAME }} + ARCHITECTURE_FLAG: ${{ steps.setup-variables.outputs.ARCHITECTURE_FLAG }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -116,7 +117,7 @@ jobs: else PRODUCTION="" fi - WAZUH_DASHBOARD_SLIM=wazuh-dashboard_${VERSION}-${REVISION}_${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'x64' || 'arm64' }}.tar.gz + WAZUH_DASHBOARD_SLIM=wazuh-dashboard_${VERSION}-${REVISION}_${{ (inputs.architecture == 'x86_64' || inputs.architecture == 'amd64') && 'x64' || 'arm64' }}.tar.gz WAZUH_SECURITY_PLUGIN=wazuh-security-dashboards-plugin_${VERSION}-${REVISION}_${{ inputs.reference_security_plugins }}.zip WAZUH_PLUGINS=wazuh-dashboard-plugins_${VERSION}-${REVISION}_${{ inputs.reference_wazuh_plugins }}.zip if [ "${{ inputs.system }}" = "deb" ]; then @@ -132,6 +133,11 @@ jobs: PACKAGE_NAME=wazuh-dashboard_${VERSION}-${{ inputs.revision }}_${{ inputs.architecture }}_${COMMIT_SHA}.rpm fi fi + if [[ "${{ inputs.architecture }}" == "x86_64" || "${{ inputs.architecture }}" == "amd64" ]]; then + ARCHITECTURE_FLAG="" + else + ARCHITECTURE_FLAG=--arm + fi echo "CURRENT_DIR=$CURRENT_DIR" >> $GITHUB_OUTPUT echo "VERSION=$VERSION" >> $GITHUB_OUTPUT echo "REVISION=$REVISION" >> $GITHUB_OUTPUT @@ -141,6 +147,7 @@ jobs: echo "WAZUH_SECURITY_PLUGIN=$WAZUH_SECURITY_PLUGIN" >> $GITHUB_OUTPUT echo "WAZUH_PLUGINS=$WAZUH_PLUGINS" >> $GITHUB_OUTPUT echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_OUTPUT + echo "ARCHITECTURE_FLAG=$ARCHITECTURE_FLAG" >> $GITHUB_OUTPUT validate-job: runs-on: ubuntu-latest @@ -242,11 +249,11 @@ jobs: cd ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages bash ./build-packages.sh \ -v ${{ needs.setup-variables.outputs.VERSION }} \ - -r ${{ inputs.revision }} \ + -r ${{ inputs.revision }} ${{ needs.setup-variables.outputs.ARCHITECTURE_FLAG }} \ -a file://${{needs.setup-variables.outputs.CURRENT_DIR}}/artifacts/wazuh-package.zip \ -s file://${{needs.setup-variables.outputs.CURRENT_DIR}}/artifacts/security-package.zip \ -b file://${{needs.setup-variables.outputs.CURRENT_DIR}}/artifacts/dashboard-package.zip \ - --${{ inputs.system }} ${{ needs.setup-variables.outputs.PRODUCTION }} + --${{ inputs.system }} --${{ inputs.architecture }} ${{ needs.setup-variables.outputs.PRODUCTION }} - name: Test package run: | From 42a9f38309dec3fff4e08a36ef2ce18d1600653e Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Tue, 10 Dec 2024 10:50:30 -0300 Subject: [PATCH 09/13] Refactor build workflow to remove ARCHITECTURE_FLAG, simplifying package build process for better clarity and consistency --- .github/workflows/build_wazuh_dashboard_with_plugins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 13d76ce54e0b..070dcc51cea1 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -253,7 +253,7 @@ jobs: -a file://${{needs.setup-variables.outputs.CURRENT_DIR}}/artifacts/wazuh-package.zip \ -s file://${{needs.setup-variables.outputs.CURRENT_DIR}}/artifacts/security-package.zip \ -b file://${{needs.setup-variables.outputs.CURRENT_DIR}}/artifacts/dashboard-package.zip \ - --${{ inputs.system }} --${{ inputs.architecture }} ${{ needs.setup-variables.outputs.PRODUCTION }} + --${{ inputs.system }} ${{ needs.setup-variables.outputs.PRODUCTION }} - name: Test package run: | From dbcc9026b32a057d2e33c8683ec7fdad9409bb36 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Tue, 10 Dec 2024 16:42:07 -0300 Subject: [PATCH 10/13] Add artifact upload step in build workflow for package outputs, improving build traceability and retention management --- .github/workflows/build_wazuh_dashboard_with_plugins.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 070dcc51cea1..6941f8057a6c 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -263,6 +263,13 @@ jobs: bash ./test-packages.sh \ -p ${{needs.setup-variables.outputs.PACKAGE_NAME}} + - uses: actions/upload-artifact@v3 + 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}} + retention-days: 30 + # - name: Set up AWS CLI # uses: aws-actions/configure-aws-credentials@v4 # with: From e79e3fd5b0a8dc74e31af3c4e6680de287df6466 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Thu, 12 Dec 2024 10:14:54 -0300 Subject: [PATCH 11/13] Revert "Add artifact upload step in build workflow for package outputs, improving build traceability and retention management" This reverts commit dbcc9026b32a057d2e33c8683ec7fdad9409bb36. --- .github/workflows/build_wazuh_dashboard_with_plugins.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 6941f8057a6c..070dcc51cea1 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -263,13 +263,6 @@ jobs: bash ./test-packages.sh \ -p ${{needs.setup-variables.outputs.PACKAGE_NAME}} - - uses: actions/upload-artifact@v3 - 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}} - retention-days: 30 - # - name: Set up AWS CLI # uses: aws-actions/configure-aws-credentials@v4 # with: From b21846174bd9cbfbca44f306da96add5b03159c5 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Thu, 12 Dec 2024 10:15:13 -0300 Subject: [PATCH 12/13] Revert "Comment out AWS CLI setup and package verification steps in the build workflow for Wazuh Dashboard with plugins" This reverts commit 9b0ca4124ea13e16f1766e4829b972e405a97f69. --- .../build_wazuh_dashboard_with_plugins.yml | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 070dcc51cea1..5c096d7e8e2c 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -165,24 +165,24 @@ jobs: exit 1 fi - # - 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: 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: Verify if package is already built - # run: | - # set +e - # echo "Verifying package" - # PACKAGE_NAME=${{ needs.setup-variables.outputs.PACKAGE_NAME }} - # exists=$(aws s3 ls s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/$PACKAGE_NAME) - # if [ -n "$exists" ]; then - # echo "Package already exists" - # exit 1 - # fi - # set -e + - name: Verify if package is already built + run: | + set +e + echo "Verifying package" + PACKAGE_NAME=${{ needs.setup-variables.outputs.PACKAGE_NAME }} + exists=$(aws s3 ls s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/$PACKAGE_NAME) + if [ -n "$exists" ]; then + echo "Package already exists" + exit 1 + fi + set -e build-base: needs: [validate-job] @@ -263,24 +263,24 @@ jobs: bash ./test-packages.sh \ -p ${{needs.setup-variables.outputs.PACKAGE_NAME}} - # - 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: 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 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}" From 6f7fddab2c9a641af44a27b5fa548cd62c2c14c2 Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Mon, 16 Dec 2024 09:05:14 -0300 Subject: [PATCH 13/13] Fix S3 upload paths in Wazuh dashboard build workflow to ensure correct package and checksum uploads --- .github/workflows/build_wazuh_dashboard_with_plugins.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wazuh_dashboard_with_plugins.yml b/.github/workflows/build_wazuh_dashboard_with_plugins.yml index 6cf55e9b56bf..a9d31222f482 100644 --- a/.github/workflows/build_wazuh_dashboard_with_plugins.yml +++ b/.github/workflows/build_wazuh_dashboard_with_plugins.yml @@ -283,7 +283,7 @@ jobs: - 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/ + aws s3 cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{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}" @@ -291,6 +291,6 @@ jobs: 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/ + aws s3 cp ${{ needs.setup-variables.outputs.CURRENT_DIR }}/dev-tools/build-packages/output/${{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}"