Skip to content

Commit 477e757

Browse files
author
Chris Every
authored
Merge pull request #313 from ovotech/add-s3-publish-for-tf
Add s3 publish for tf
2 parents 8b6d26f + c88b9c2 commit 477e757

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.circleci/config.yml

+21-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,19 @@ jobs:
3636
ZIP_NAME=cloud-key-rotator_${VERSION}_cloudfunction.zip
3737
zip -R ${ZIP_NAME} '*.go' 'go.mod'
3838
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_TAG} ${ZIP_NAME}
39-
39+
publish_tf_lambda_zip:
40+
docker:
41+
- image: python:3
42+
steps:
43+
- checkout
44+
- run:
45+
name: publish
46+
command: |
47+
VERSION=$(echo ${CIRCLE_TAG} | sed 's/^v//')
48+
TARGET_FILE=cloud-key-rotator_${VERSION}_lambda.zip
49+
curl -L https://github.com/ovotech/cloud-key-rotator/releases/download/v${VERSION}/${TARGET_FILE} -O
50+
pip3 install awscli
51+
aws s3 cp $TARGET_FILE s3://ckr-terraform-module-code --acl public-read
4052
tf_check_aws:
4153
executor: terraform/terraform-0_12
4254
steps:
@@ -173,6 +185,14 @@ workflows:
173185
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
174186
branches:
175187
ignore: /.*/
188+
- publish_tf_lambda_zip:
189+
requires:
190+
- goreleaser
191+
filters:
192+
tags:
193+
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
194+
branches:
195+
ignore: /.*/
176196
pr_pipeline:
177197
jobs:
178198
- go_fmt:

0 commit comments

Comments
 (0)