From 1c4433ae665f2fec98ab32cf02636ba7a5518d33 Mon Sep 17 00:00:00 2001 From: Enrique Araque Date: Fri, 11 Oct 2024 17:03:35 +0200 Subject: [PATCH 01/10] Add checksum step with artifact to test it --- .../builder_installation_assistant.yml | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/.github/workflows/builder_installation_assistant.yml b/.github/workflows/builder_installation_assistant.yml index a85d683..5ba4375 100644 --- a/.github/workflows/builder_installation_assistant.yml +++ b/.github/workflows/builder_installation_assistant.yml @@ -12,16 +12,29 @@ on: description: "Is stage?" type: boolean default: false + checksum: + description: "Add checksum" + type: boolean + default: false id: description: "ID used to identify the workflow uniquely." type: string required: false workflow_call: inputs: + WAZUH_INSTALLATION_ASSISTANT_REFERENCE: + description: "Branch or tag of the wazuh-installation-assistant repository." + type: string + required: true + default: 4.10.0 is_stage: description: "Is stage?" type: boolean default: false + checksum: + description: "Add checksum" + type: boolean + default: false id: type: string required: false @@ -73,14 +86,37 @@ jobs: - name: Build Installation Assistant packages run: bash builder.sh -i -c -p + + - name: Save files name + run: | + WAZUH_INSTALL_NAME=$(ls ${{ github.workspace }}/${{ env.WAZUH_INSTALL_NAME }}*.sh) + WAZUH_CERT_TOOL_NAME=$(ls ${{ github.workspace }}/${{ env.WAZUH_CERT_TOOL_NAME }}*.sh) + WAZUH_PASSWORD_TOOL_NAME=$(ls ${{ github.workspace }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}*.sh) + echo "WAZUH_INSTALL_NAME=$WAZUH_INSTALL_NAME" >> $GITHUB_ENV + echo "WAZUH_CERT_TOOL_NAME=$WAZUH_CERT_TOOL_NAME" >> $GITHUB_ENV + echo "WAZUH_PASSWORD_TOOL_NAME=$WAZUH_PASSWORD_TOOL_NAME" >> $GITHUB_ENV - name: Prepare files run: | mkdir -p ${{ github.workspace }}/${{ env.WAZUH_VERSION }} - mv ${{ env.WAZUH_INSTALL_NAME }}*.sh ${{ github.workspace }}/${{ env.WAZUH_VERSION }} - mv ${{ env.WAZUH_CERT_TOOL_NAME }}*.sh ${{ github.workspace }}/${{ env.WAZUH_VERSION }} - mv ${{ env.WAZUH_PASSWORD_TOOL_NAME }}*.sh ${{ github.workspace }}/${{ env.WAZUH_VERSION }} - - - name: Upload files to S3 + mv ${{ env.WAZUH_INSTALL_NAME }} ${{ github.workspace }}/${{ env.WAZUH_VERSION }} + mv ${{ env.WAZUH_CERT_TOOL_NAME }} ${{ github.workspace }}/${{ env.WAZUH_VERSION }} + mv ${{ env.WAZUH_PASSWORD_TOOL_NAME }} ${{ github.workspace }}/${{ env.WAZUH_VERSION }} + + - name: Build packages checksum + if: ${{ inputs.checksum == true }} run: | - aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} --recursive + sha512sum ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }} > ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}.sha512 + sha512sum ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }} > ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512 + sha512sum ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }} > ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}.sha512 + + - name: Build test artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: wazuh-installation-assistant-${{ env.WAZUH_VERSION }} + path: ${{ github.workspace }}/${{ env.WAZUH_VERSION }} + + # - name: Upload files to S3 + # run: | + # aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} --recursive From 6b9698f3c455fe1a1b8bdae522684730321c11e0 Mon Sep 17 00:00:00 2001 From: Enrique Araque Date: Fri, 11 Oct 2024 17:11:48 +0200 Subject: [PATCH 02/10] Fix file basename --- .github/workflows/builder_installation_assistant.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/builder_installation_assistant.yml b/.github/workflows/builder_installation_assistant.yml index 5ba4375..aac43f9 100644 --- a/.github/workflows/builder_installation_assistant.yml +++ b/.github/workflows/builder_installation_assistant.yml @@ -89,9 +89,9 @@ jobs: - name: Save files name run: | - WAZUH_INSTALL_NAME=$(ls ${{ github.workspace }}/${{ env.WAZUH_INSTALL_NAME }}*.sh) - WAZUH_CERT_TOOL_NAME=$(ls ${{ github.workspace }}/${{ env.WAZUH_CERT_TOOL_NAME }}*.sh) - WAZUH_PASSWORD_TOOL_NAME=$(ls ${{ github.workspace }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}*.sh) + WAZUH_INSTALL_NAME=$(ls ${{ github.workspace }}/${{ env.WAZUH_INSTALL_NAME }}*.sh | xargs basename) + WAZUH_CERT_TOOL_NAME=$(ls ${{ github.workspace }}/${{ env.WAZUH_CERT_TOOL_NAME }}*.sh | xargs basename) + WAZUH_PASSWORD_TOOL_NAME=$(ls ${{ github.workspace }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}*.sh | xargs basename) echo "WAZUH_INSTALL_NAME=$WAZUH_INSTALL_NAME" >> $GITHUB_ENV echo "WAZUH_CERT_TOOL_NAME=$WAZUH_CERT_TOOL_NAME" >> $GITHUB_ENV echo "WAZUH_PASSWORD_TOOL_NAME=$WAZUH_PASSWORD_TOOL_NAME" >> $GITHUB_ENV From 31f0d4253f80856f09b202f8d7004a595c996a8c Mon Sep 17 00:00:00 2001 From: Enrique Araque Date: Fri, 11 Oct 2024 17:35:16 +0200 Subject: [PATCH 03/10] Add upload to s3 steps --- .../builder_installation_assistant.yml | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/builder_installation_assistant.yml b/.github/workflows/builder_installation_assistant.yml index aac43f9..1bfe274 100644 --- a/.github/workflows/builder_installation_assistant.yml +++ b/.github/workflows/builder_installation_assistant.yml @@ -110,13 +110,27 @@ jobs: sha512sum ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }} > ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512 sha512sum ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }} > ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}.sha512 - - name: Build test artifact - if: always() - uses: actions/upload-artifact@v4 - with: - name: wazuh-installation-assistant-${{ env.WAZUH_VERSION }} - path: ${{ github.workspace }}/${{ env.WAZUH_VERSION }} + - name: Upload files to S3 + run: | + aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} + s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}" + echo "S3 wazuh-install URI: ${s3uri}" + aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} + s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}" + echo "S3 wazuh-certs-tool URI: ${s3uri}" + aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} + s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}" + echo "S3 wazuh-passwords-tool URI: ${s3uri}" - # - name: Upload files to S3 - # run: | - # aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} --recursive + - name: Upload checksum files to S3 + if: ${{ inputs.checksum == true }} + run: | + aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} + s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}.sha512" + echo "S3 sha512 wazuh-install checksum URI: ${s3uri}" + aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} + s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512" + echo "S3 sha512 wazuh-certs-tool checksum URI: ${s3uri}" + aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} + s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}.sha512" + echo "S3 sha512 wazuh-passwords-tool checksum URI: ${s3uri}" \ No newline at end of file From 248087928cb6fad5d81c565e470aa404d5286a77 Mon Sep 17 00:00:00 2001 From: Enrique Araque Date: Fri, 11 Oct 2024 17:45:28 +0200 Subject: [PATCH 04/10] Add bucket as string --- .github/workflows/builder_installation_assistant.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/builder_installation_assistant.yml b/.github/workflows/builder_installation_assistant.yml index 1bfe274..00e7d5f 100644 --- a/.github/workflows/builder_installation_assistant.yml +++ b/.github/workflows/builder_installation_assistant.yml @@ -40,7 +40,7 @@ on: required: false env: - S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + S3_BUCKET: "packages-dev.internal.wazuh.com" S3_REPOSITORY_PATH: "development/wazuh/4.x/secondary/installation-assistant" BUILDER_PATH: "builder.sh" WAZUH_INSTALL_NAME: "wazuh-install" From 2867c50e847b6ceeb6481b60a7cabd0430394c82 Mon Sep 17 00:00:00 2001 From: Enrique Araque Date: Fri, 11 Oct 2024 18:22:49 +0200 Subject: [PATCH 05/10] Fix s3 path --- .github/workflows/builder_installation_assistant.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/builder_installation_assistant.yml b/.github/workflows/builder_installation_assistant.yml index 00e7d5f..9d75e51 100644 --- a/.github/workflows/builder_installation_assistant.yml +++ b/.github/workflows/builder_installation_assistant.yml @@ -112,25 +112,25 @@ jobs: - name: Upload files to S3 run: | - aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} + aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}" echo "S3 wazuh-install URI: ${s3uri}" - aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} + aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}" echo "S3 wazuh-certs-tool URI: ${s3uri}" - aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} + aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}" echo "S3 wazuh-passwords-tool URI: ${s3uri}" - name: Upload checksum files to S3 if: ${{ inputs.checksum == true }} run: | - aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} + aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}.sha512" echo "S3 sha512 wazuh-install checksum URI: ${s3uri}" - aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} + aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512" echo "S3 sha512 wazuh-certs-tool checksum URI: ${s3uri}" - aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} + aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}.sha512" echo "S3 sha512 wazuh-passwords-tool checksum URI: ${s3uri}" \ No newline at end of file From fc19b1911321d2d648ae3f9472bef59780cba572 Mon Sep 17 00:00:00 2001 From: Enrique Araque Date: Fri, 11 Oct 2024 19:17:14 +0200 Subject: [PATCH 06/10] Change URI echo ti maintain consistency --- .github/workflows/builder_installation_assistant.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/builder_installation_assistant.yml b/.github/workflows/builder_installation_assistant.yml index 9d75e51..95df83f 100644 --- a/.github/workflows/builder_installation_assistant.yml +++ b/.github/workflows/builder_installation_assistant.yml @@ -114,7 +114,7 @@ jobs: run: | aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}" - echo "S3 wazuh-install URI: ${s3uri}" + echo "S3 wazuh-install-tool URI: ${s3uri}" aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}" echo "S3 wazuh-certs-tool URI: ${s3uri}" @@ -127,10 +127,10 @@ jobs: run: | aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}.sha512" - echo "S3 sha512 wazuh-install checksum URI: ${s3uri}" + echo "S3 sha512 wazuh-install-tool checksum URI: ${s3uri}" aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512" echo "S3 sha512 wazuh-certs-tool checksum URI: ${s3uri}" aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}.sha512" - echo "S3 sha512 wazuh-passwords-tool checksum URI: ${s3uri}" \ No newline at end of file + echo "S3 sha512 wazuh-passwords-tool checksum URI: ${s3uri}" From b0b73474044716b584fdb3eb765b909e1838007b Mon Sep 17 00:00:00 2001 From: Enrique Araque Date: Wed, 16 Oct 2024 16:34:19 +0200 Subject: [PATCH 07/10] Change variables name --- .github/workflows/builder_installation_assistant.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/builder_installation_assistant.yml b/.github/workflows/builder_installation_assistant.yml index 95df83f..327a375 100644 --- a/.github/workflows/builder_installation_assistant.yml +++ b/.github/workflows/builder_installation_assistant.yml @@ -4,7 +4,7 @@ name: Build Installation Assistant on: workflow_dispatch: inputs: - WAZUH_INSTALLATION_ASSISTANT_REFERENCE: + wazuh_installation_assistant_reference: description: "Branch or tag of the wazuh-installation-assistant repository." required: true default: 4.10.0 @@ -22,7 +22,7 @@ on: required: false workflow_call: inputs: - WAZUH_INSTALLATION_ASSISTANT_REFERENCE: + wazuh_installation_assistant_reference: description: "Branch or tag of the wazuh-installation-assistant repository." type: string required: true @@ -40,7 +40,7 @@ on: required: false env: - S3_BUCKET: "packages-dev.internal.wazuh.com" + S3_BUCKET: ${{ vars.AWS_S3_BUCKET}} S3_REPOSITORY_PATH: "development/wazuh/4.x/secondary/installation-assistant" BUILDER_PATH: "builder.sh" WAZUH_INSTALL_NAME: "wazuh-install" @@ -62,7 +62,7 @@ jobs: - name: Checkout wazuh-installation-assistant repository uses: actions/checkout@v4 with: - ref: ${{ inputs.WAZUH_INSTALLATION_ASSISTANT_REFERENCE }} + ref: ${{ inputs.wazuh_installation_assistant_reference }} - name: Configure aws credentials uses: aws-actions/configure-aws-credentials@v3 @@ -127,7 +127,7 @@ jobs: run: | aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}.sha512" - echo "S3 sha512 wazuh-install-tool checksum URI: ${s3uri}" + echo "S3 sha512 wazuh-install checksum URI: ${s3uri}" aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512" echo "S3 sha512 wazuh-certs-tool checksum URI: ${s3uri}" From 5b13891fad71aa426ab3e0201271faa1eb7d55a9 Mon Sep 17 00:00:00 2001 From: Enrique Araque Date: Wed, 16 Oct 2024 16:42:20 +0200 Subject: [PATCH 08/10] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1010cd..4c1e559 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. ### Changed +- Add checksum input and update the upload files to S3 steps ([#106](https://github.com/wazuh/wazuh-installation-assistant/pull/106)) - Deleted the offline_checkDependencies function and unified logic in offline_checkPrerequisites function. ([#99](https://github.com/wazuh/wazuh-installation-assistant/pull/99)) - Add input for wazuh installation assistant reference in workflows. ([#98](https://github.com/wazuh/wazuh-installation-assistant/pull/98)) - Create GHA workflow to build Wazuh Installation Assistant files. ([#77](https://github.com/wazuh/wazuh-installation-assistant/pull/77)) From d24d2a57e4896e13460928bbef3ec583a6b9020a Mon Sep 17 00:00:00 2001 From: Enrique Araque Date: Wed, 16 Oct 2024 16:47:07 +0200 Subject: [PATCH 09/10] Fix s3 bucket env variable --- .github/workflows/builder_installation_assistant.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/builder_installation_assistant.yml b/.github/workflows/builder_installation_assistant.yml index 327a375..faea88f 100644 --- a/.github/workflows/builder_installation_assistant.yml +++ b/.github/workflows/builder_installation_assistant.yml @@ -40,7 +40,7 @@ on: required: false env: - S3_BUCKET: ${{ vars.AWS_S3_BUCKET}} + S3_BUCKET: ${{ vars.AWS_S3_BUCKET }} S3_REPOSITORY_PATH: "development/wazuh/4.x/secondary/installation-assistant" BUILDER_PATH: "builder.sh" WAZUH_INSTALL_NAME: "wazuh-install" From 632a162490e50ecc8578362cecb67dd6f61d6e3a Mon Sep 17 00:00:00 2001 From: Enrique Araque Date: Wed, 16 Oct 2024 16:52:44 +0200 Subject: [PATCH 10/10] Remove -tool from echo in upload files to S3 step --- .github/workflows/builder_installation_assistant.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/builder_installation_assistant.yml b/.github/workflows/builder_installation_assistant.yml index faea88f..892d6ac 100644 --- a/.github/workflows/builder_installation_assistant.yml +++ b/.github/workflows/builder_installation_assistant.yml @@ -114,7 +114,7 @@ jobs: run: | aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}" - echo "S3 wazuh-install-tool URI: ${s3uri}" + echo "S3 wazuh-install URI: ${s3uri}" aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}" echo "S3 wazuh-certs-tool URI: ${s3uri}"