From f60bcda84fd9a7cf07dd85ad67a0c7c7bbb1dc89 Mon Sep 17 00:00:00 2001 From: Brandon Pfeifer Date: Mon, 27 Nov 2023 15:40:14 -0500 Subject: [PATCH] chore: upload artifacts to another bucket --- .circleci/config.yml | 71 ++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4e90fbeee8f..f154d197ccd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,7 @@ version: 2.1 orbs: - aws-s3: circleci/aws-s3@2.0.0 + aws-cli: circleci/aws-cli@4.1.2 + aws-s3: circleci/aws-s3@4.0.0 parameters: cross-container-tag: # when updating the go version, should also update the go version in go.mod @@ -319,50 +320,48 @@ jobs: paths: - changelog_artifacts - s3-publish-changelog: + publish_changelog: + docker: + - image: cimg/base:current parameters: build_type: type: string - docker: - - image: ubuntu:latest steps: - attach_workspace: at: /tmp/workspace - - checkout - - run: - name: Publish CHANGELOG.md to S3 - command: | - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y awscli - - pushd /tmp/workspace/changelog_artifacts/ + - aws-cli/setup: + aws_access_key_id: INFLUXDB1X_AWS_ACCESS_KEY_ID + aws_secret_access_key: INFLUXDB1X_AWS_SECRET_ACCESS_KEY + region: us-east-1 + - when: + condition: + equal: [ << parameters.build_type >>, nightly ] + steps: + - aws-s3/copy: + from: /tmp/workspace/changelog_artifacts/CHANGELOG.md + to: s3://${INFLUXDB1X_ARTIFACTS_BUCKET}/influxdb/1.10/CHANGELOG.nightly.md + - when: + condition: + equal: [ << parameters.build_type >>, release ] + steps: + - aws-s3/copy: + from: /tmp/workspace/changelog_artifacts/CHANGELOG.md + to: s3://${INFLUXDB1X_ARTIFACTS_BUCKET}/influxdb/1.10/CHANGELOG.<< pipeline.git.tag >>.md - case "<< parameters.build_type >>" - in - nightly) - aws s3 cp CHANGELOG.md "s3://dl.influxdata.com/platform/nightlies/<< pipeline.git.branch >>/CHANGELOG.md" - ;; - release) - aws s3 cp CHANGELOG.md "s3://dl.influxdata.com/influxdb/releases/CHANGELOG.<< pipeline.git.tag >>.md" - ;; - esac - - s3-publish-packages: + publish_packages: docker: - - image: ubuntu:latest + - image: cimg/base:current steps: - attach_workspace: at: /tmp/workspace - checkout - - run: - name: Publish Packages to S3 - command: | - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y awscli - - aws s3 sync /tmp/workspace/packages "s3://dl.influxdata.com/influxdb/releases" + - aws-cli/setup: + aws_access_key_id: INFLUXDB1X_AWS_ACCESS_KEY_ID + aws_secret_access_key: INFLUXDB1X_AWS_SECRET_ACCESS_KEY + region: us-east-1 + - aws-s3/sync: + from: /tmp/workspace/packages + to: s3://${INFLUXDB1X_ARTIFACTS_BUCKET}/influxdb/1.10/ release_filter: &release_filter filters: @@ -397,12 +396,12 @@ workflows: - build_packages - changelog: <<: *release_filter - - s3-publish-changelog: + - publish_changelog: <<: *release_filter build_type: release requires: - changelog - - s3-publish-packages: + - publish_packages: <<: *release_filter requires: - sign_packages @@ -446,7 +445,7 @@ workflows: - equal: [ << pipeline.parameters.workflow >>, nightly ] jobs: - changelog - - s3-publish-changelog: + - publish_changelog: build_type: nightly requires: - changelog