Skip to content

Commit

Permalink
chore: upload artifacts to another bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
bnpfeife committed Nov 27, 2023
1 parent d596c4d commit f60bcda
Showing 1 changed file with 35 additions and 36 deletions.
71 changes: 35 additions & 36 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 2.1
orbs:
aws-s3: circleci/[email protected]
aws-cli: circleci/[email protected]
aws-s3: circleci/[email protected]
parameters:
cross-container-tag:
# when updating the go version, should also update the go version in go.mod
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -446,7 +445,7 @@ workflows:
- equal: [ << pipeline.parameters.workflow >>, nightly ]
jobs:
- changelog
- s3-publish-changelog:
- publish_changelog:
build_type: nightly
requires:
- changelog
Expand Down

0 comments on commit f60bcda

Please sign in to comment.