From d790f3af03d64497e8d91632b1eeb53594514dcd Mon Sep 17 00:00:00 2001 From: Raul Del Pozo Moreno Date: Fri, 7 Jun 2024 12:21:00 +0200 Subject: [PATCH] Added S3 URI output to package generation upload (#249) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added S3 URI output * Added ID input and S3 URI output * Improved workflow run name * Added name statement * Added name statement * Removed file * Added ID input description * Update build.yml --------- Co-authored-by: Álex Ruiz --- .github/workflows/build.yml | 12 +++++ .github/workflows/build_single.yml | 78 ------------------------------ 2 files changed, 12 insertions(+), 78 deletions(-) delete mode 100644 .github/workflows/build_single.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9ec941531217..9afe6c40034fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,3 +1,4 @@ +run-name: Build ${{ inputs.distribution }} Wazuh Indexer on ${{ inputs.architecture }} | ${{ inputs.id }} name: Build packages (on demand) # This workflow runs when any of the following occur: @@ -30,6 +31,10 @@ on: description: "Checksum ?" type: boolean default: false + id: + description: "ID used to identify the workflow uniquely." + type: string + required: false workflow_call: inputs: revision: @@ -56,6 +61,9 @@ on: description: "Checksum ?" type: boolean default: false + id: + type: string + required: false secrets: CI_INTERNAL_DEVELOPMENT_BUCKET_USER_ACCESS_KEY: required: true @@ -185,6 +193,8 @@ jobs: src="artifacts/dist/${{ steps.package.outputs.name }}" dest="s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/" aws s3 cp "$src" "$dest" + s3uri="${dest}${{ steps.package.outputs.name }}" + echo "S3 URI: ${s3uri}" - name: Upload checksum to S3 if: ${{ inputs.upload && inputs.checksum }} @@ -192,3 +202,5 @@ jobs: src="artifacts/dist/${{ steps.package.outputs.name }}.sha512" dest="s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/" aws s3 cp "$src" "$dest" + s3uri="${dest}${{ steps.package.outputs.name }}.sha512" + echo "S3 sha512 URI: ${s3uri}" diff --git a/.github/workflows/build_single.yml b/.github/workflows/build_single.yml deleted file mode 100644 index 56be9cd9f1e90..0000000000000 --- a/.github/workflows/build_single.yml +++ /dev/null @@ -1,78 +0,0 @@ -run-name: Build ${{ inputs.system }} wazuh-indexer on ${{ inputs.architecture }} | ${{ inputs.id }} - -# This workflow runs when any of the following occur: -# - Run from another worklow of GH API -# - Run manually -on: - workflow_call: - inputs: - revision: - description: "Revision" - type: string - default: "0" - checksum: - description: "Checksum ?" - type: boolean - default: false - is_stage: - description: "Is stage ?" - type: boolean - default: false - system: - description: "Package OS" - type: string - default: deb - architecture: - description: "Package architecture" - type: string - default: amd64 - id: - description: "ID used to identify the workflow uniquely." - type: string - required: false - - workflow_dispatch: - inputs: - revision: - description: "Revision" - type: string - default: "0" - checksum: - description: "Checksum ?" - type: boolean - default: false - is_stage: - description: "Is stage ?" - type: boolean - default: false - system: - description: "Package OS" - type: choice - options: - - rpm - - deb - default: deb - architecture: - description: "Package architecture" - type: choice - options: - - amd64 - - x86_64 - default: amd64 - id: - description: "ID used to identify the workflow uniquely." - type: string - required: false - -jobs: - call-build-workflow: - uses: ./.github/workflows/build.yml - with: - revision: ${{ inputs.revision }} - checksum: ${{ inputs.checksum }} - is_stage: ${{ inputs.is_stage }} - distribution: '[ "${{ inputs.system }}" ]' - upload: true - # Architecture is always 'x64', which is the default value in ./build.yml - # It is an input just for convenience and standardisation. - secrets: inherit