Skip to content

Commit

Permalink
chore: Publish CHANGELOG.md to S3 (#2705)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnpfeife authored Jul 15, 2022
1 parent 4f8a995 commit 70eade7
Showing 1 changed file with 64 additions and 22 deletions.
86 changes: 64 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:
- run_tests
- deploy_nightly

nightly-changelog:
changelog:
docker:
- image: quay.io/influxdb/changelogger:0dbf37ba8a912460358d322dcad414b80ce074f2
steps:
Expand All @@ -179,36 +179,74 @@ jobs:
#TODO: delete contents of CHANGELOG.md in repo root and replace with link to changelog in S3
- store_artifacts:
path: changelog_artifacts/
#TODO: push changelog to S3 with aws-s3/copy (see influxdb .circleci/config.yml)
- persist_to_workspace:
root: .
paths:
- changelog_artifacts

s3-publish-changelog:
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/
case "<< parameters.build_type >>"
in
nightly)
aws s3 cp CHANGELOG.md "s3://dl.influxdata.com/kapacitor/nightlies/CHANGELOG.md"
;;
release)
aws s3 cp CHANGELOG.md "s3://dl.influxdata.com/kapacitor/releases/CHANGELOG.<< pipeline.git.tag >>.md"
;;
esac
release_filter: &release_filter
filters:
tags:
only:
- /^v[0-9]+(\.[0-9]+){2}(-(rc|beta)[0-9]+)?/
branches:
ignore: /.*/

any_filter: &any_filter
filters:
tags:
only: /.*/
branches:
only: /.*/

workflows:
version: 2
build-and-deploy:
jobs:
- build:
filters:
tags:
only: /.*/
<<: *any_filter
- release:
<<: *release_filter
requires:
- build
filters:
tags:
only:
- /^v[0-9]+(\.[0-9]+){2}(-(rc|beta)[0-9]+)?/
- /^.*test$/
branches:
ignore: /.*/
- static_code_checks:
filters:
tags:
only: /.*/
# FIXME: don't run nightly changelog update on merge (remove this section)
- nightly-changelog:
filters:
branches:
only:
- master
<<: *any_filter
- changelog:
<<: *any_filter
- s3-publish-changelog:
<<: *release_filter
build_type: release
requires:
- changelog
nightly:
triggers:
- schedule:
Expand All @@ -219,4 +257,8 @@ workflows:
- master
jobs:
- nightly-build
- nightly-changelog
- changelog
- s3-publish-changelog:
build_type: nightly
requires:
- changelog

0 comments on commit 70eade7

Please sign in to comment.