Skip to content

Commit 0152159

Browse files
author
Filip Schouwenaars
authored
Merge pull request #502 from datacamp/fs/update-ci
Fs/update ci
2 parents 90b9e75 + d926cc0 commit 0152159

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

.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

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ follow these steps:
4848
4. `ALTER USER 'root' IDENTIFIED WITH mysql_native_password BY 'password';`
4949
5. `flush privileges;`
5050

51-
## How to deploy
5251

53-
- To deploy to stating (rdocumentation.datacamp-staging.com), merge to master
54-
- To deploy to production, add a tag which starts with `release-`
55-
The rdocumentation app is hosted on DataCamp's infrastructure, on our AWS ECS cluster.
52+
## Deployment
53+
54+
- Commits to master are deployed to staging
55+
- Tags that use `vx.y.z` are deployed to production
5656

5757
## What the CI does
5858

ecs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
},
5353
{
5454
"containerName": "rdoc-app-sqsd",
55-
"containerURI": "filipsch/sqsd:latest",
55+
"containerURI": "708371444347.dkr.ecr.us-east-1.amazonaws.com/sqsd:latest",
5656
"memoryReservation": 128,
5757
"essential": true,
5858
"containerCommand": [

0 commit comments

Comments
 (0)