Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 982c119

Browse files
test: testing uploading artifact and tagging with commit id
1 parent 8f1ea2d commit 982c119

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.circleci/config.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,25 @@ commands:
6262
pushd www/
6363
tar -cvf artifact.tar *
6464
mv artifact.tar ${OLDPWD}/
65+
- run:
66+
name: "Tag commit id as artifact identifer"
67+
command: echo "${CIRCLE_SHA1}" > artifact-info.txt
6568
upload_artifact:
6669
description: "upload artifact to s3"
6770
steps:
6871
- s3/copy:
6972
from: artifact.tar
70-
to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}/' # using ${CIRCLE_BRANCH} for separating build artifact by branch
73+
to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/'
7174
aws-access-key-id: env_CONTEXT_ARTIFACT_S3_AWS_ACCESS_KEY_ID
7275
aws-secret-access-key: env_CONTEXT_ARTIFACT_S3_AWS_SECRET_ACCESS_KEY
7376
aws-region: env_CONTEXT_ARTIFACT_S3_AWS_REGION
77+
arguments: '--metadata "{\"x-amz-artifact-id\": \"${CIRCLE_SHA1}\" }"'
7478
upload_checksum:
75-
description: "upload artifact checksum to s3"
79+
description: "upload artifact commit id to s3"
7680
steps:
77-
- run:
78-
name:
79-
command: |
80-
sha256sum artifact.tar | cut -d ' ' -f 1 > artifact-info.txt
8181
- s3/copy:
8282
from: artifact-info.txt
83-
to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}/' # using ${CIRCLE_BRANCH} for separating build artifact by branch
83+
to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/'
8484
aws-access-key-id: env_CONTEXT_ARTIFACT_S3_AWS_ACCESS_KEY_ID
8585
aws-secret-access-key: env_CONTEXT_ARTIFACT_S3_AWS_SECRET_ACCESS_KEY
8686
aws-region: env_CONTEXT_ARTIFACT_S3_AWS_REGION
@@ -163,10 +163,10 @@ jobs:
163163
- compress
164164
- upload_artifact # uploading the built code to s3 to create a backup of key services separate from Kubernetes deployment
165165
- upload_checksum # uploading compressed artifact checksum to cross match artifact fingerprint before actual deployment
166-
#- docker:
167-
# target: "production"
168-
#- k8s_deploy:
169-
# target: "production"
166+
- docker:
167+
target: "production"
168+
- k8s_deploy:
169+
target: "production"
170170

171171
workflows:
172172
test:
@@ -187,5 +187,5 @@ workflows:
187187
ignore: /.*/
188188
tags:
189189
only: /^production.*/
190-
context: binary-frontend-deploy
190+
context: binary-frontend-artifact-upload
191191

0 commit comments

Comments
 (0)