From 3dabfcdd08e76cd424469c753814c8ef9bf5046a Mon Sep 17 00:00:00 2001 From: Brandon Pfeifer Date: Tue, 13 Jun 2023 20:00:45 -0400 Subject: [PATCH] fix: correct CHANGELOG.md upload destination (#24287) This updates the job logic so that workflow condition is evaluated by CircleCI rather than the shell. This also uses the "aws-s3" orb for uploading to S3 (rather than awscli). --- .circleci/config.yml | 70 ++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3dbb4564a4..e85a230cc0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -898,25 +898,28 @@ jobs: changelog: parameters: workflow: - type: string - default: snapshot + type: string docker: - image: quay.io/influxdb/changelogger:latest steps: - checkout - - run: | - export DESCRIPTION="In addition to the list of changes below, please also see the [official release \ - notes](https://docs.influxdata.com/influxdb/${CIRCLE_BRANCH}/reference/release-notes/influxdb/) for \ - other important information about this release." + - when: + condition: + or: + - equal: [ << parameters.workflow >>, nightly ] + - equal: [ << parameters.workflow >>, snapshot ] + steps: + - run: changelogger --product OSS + - when: + condition: + equal: [ << parameters.workflow >>, release ] + steps: + - run: | + export DESCRIPTION="In addition to the list of changes below, please also see the [official release \ + notes](https://docs.influxdata.com/influxdb/${CIRCLE_BRANCH}/reference/release-notes/influxdb/) for \ + other important information about this release." - case << parameters.workflow >> in - release) - changelogger --product OSS --release "${CIRCLE_TAG}" --description "${DESCRIPTION}" - ;; - nightly|snapshot) - changelogger --product OSS - ;; - esac + changelogger --product OSS --release "<< pipeline.git.tag >>" --description "${DESCRIPTION}" - store_artifacts: path: changelog_artifacts/ - persist_to_workspace: @@ -927,27 +930,32 @@ jobs: changelog-upload: parameters: workflow: - type: string - default: release + type: string docker: - - image: ubuntu:latest + - image: cimg/python:3.6 steps: - attach_workspace: at: /tmp/workspace - - checkout - - run: | - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install --yes --no-install-recommends awscli - - case << parameters.workflow >> in - release) - aws s3 cp /tmp/workspace/CHANGELOG.md "s3://dl.influxdata.com/influxdb/releases/CHANGELOG.${CIRCLE_SHA1}.md" - ;; - nightly) - aws s3 cp /tmp/workspace/CHANGELOG.md "s3://dl.influxdata.com/platform/nightlies/${CIRCLE_TAG}/CHANGELOG.md" - ;; - esac + - when: + condition: + equal: [ << parameters.workflow >>, release ] + steps: + - aws-s3/copy: + aws-region: AWS_S3_REGION + aws-access-key-id: AWS_ACCESS_KEY_ID + aws-secret-access-key: AWS_SECRET_ACCESS_KEY + to: "s3://dl.influxdata.com/influxdb/releases/CHANGELOG.<< pipeline.git.tag >>.md" + from: /tmp/workspace/CHANGELOG.md + - when: + condition: + equal: [ << parameters.workflow >>, nightly ] + steps: + - aws-s3/copy: + aws-region: AWS_S3_REGION + aws-access-key-id: AWS_ACCESS_KEY_ID + aws-secret-access-key: AWS_SECRET_ACCESS_KEY + to: "s3://dl.influxdata.com/platform/nightlies/<< pipeline.git.branch >>/CHANGELOG.md" + from: /tmp/workspace/CHANGELOG.md check_package_deb_amd64: machine: