Skip to content

Commit 1e9353b

Browse files
committed
chore(ci): update deploy strategy
- Pushes to master are deployed to staging now - Tags that use vx.y.z are deployed to production
1 parent 90b9e75 commit 1e9353b

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

.circleci/config.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,39 @@ workflows:
1313
aws-secret-access-key: $OPS_AWS_SECRET_ACCESS_KEY
1414
account-url: $OPS_ECR_URL
1515
puller-account-ids: '["301258414863", "487088987264"]'
16+
extra-docker-args: "--build-arg VERSION=$(git describe --tags)"
1617
repo: rdoc-app
18+
executor: datacamp-ecr/buildkit
19+
filters:
20+
branches:
21+
only:
22+
- master
23+
tags:
24+
only: /^v\d+\.\d+\.\d+$/
1725
- datacamp-deploy/deploy: # Staging
26+
name: deploy-staging
1827
context: org-global
1928
requires:
2029
- build
2130
environment: staging
2231
aws-access-key-id: $STAGING_AWS_ACCESS_KEY_ID
2332
aws-secret-access-key: $STAGING_AWS_SECRET_ACCESS_KEY
33+
extra-env: "VERSION=$(git describe --tags)"
2434
filters:
2535
branches:
2636
only:
2737
- master
2838
- datacamp-deploy/deploy: # Production
39+
name: deploy-production
2940
context: org-global
3041
requires:
3142
- build
3243
environment: prod
3344
aws-access-key-id: $PROD_AWS_ACCESS_KEY_ID
3445
aws-secret-access-key: $PROD_AWS_SECRET_ACCESS_KEY
46+
extra-env: "VERSION=$(git describe --tags)"
3547
filters:
48+
tags:
49+
only: /^v\d+\.\d+\.\d+$/
3650
branches:
37-
only:
38-
- master
51+
ignore: /.*/

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
FROM node:8.16
22

3-
MAINTAINER Ludovic Vannoorenberghe <ludo@datacamp.com>
4-
53
RUN apt-get update && apt-get install -y python build-essential
64

75
RUN npm install -g pm2 node-gyp sails grunt bower jake npm-check-updates
86

7+
ARG VERSION
8+
ENV VERSION=${VERSION}
9+
910
ENV NODE_ENV production
11+
1012
# use changes to package.json to force Docker not to use the cache
1113
# when we change our application's nodejs dependencies:
1214
ADD package.json /tmp/package.json

0 commit comments

Comments
 (0)