forked from veteransaffairscanada/vac-benefits-directory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
134 lines (121 loc) · 4.18 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:9
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4
working_directory: ~/repo
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: yarn install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
# run tests!
- run: yarn test -w2
- run:
command: node node_modules/eslint/bin/eslint.js pages components __tests__
name: lint
- run:
command: ~/repo/.circleci/notify_failure.sh
name: "Report failing Master"
when: on_fail
integration:
docker:
# the Docker image with Cypress dependencies
- image: cypress/base:10
environment:
## this enables colors in the output
TERM: xterm
working_directory: ~/app
parallelism: 1
steps:
- checkout
- restore_cache:
keys:
- v1-npm-deps-{{ checksum "package.json" }}
- run: yarn --ignore-engines install
- save_cache:
key: v1-npm-deps-{{ checksum "package.json" }}
paths:
- node_modules
- run:
name: Running E2E tests
command: |
yarn build
yarn start &
yarn cypress:wait
yarn cypress:run
- run:
command: ~/repo/.circleci/notify_failure.sh
name: "Report failing Master"
when: on_fail
- store_test_results:
path: cypress-results
- store_artifacts:
path: cypress/videos
- store_artifacts:
path: cypress/screenshots
deploy:
docker:
- image: docker:17.12.1-ce-git
steps:
- checkout:
path: ~/repo
- setup_remote_docker
- run:
command: |
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
docker build -t "${DOCKER_REGISTRY}/${NAMESPACE}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_SHA1}" -t "${DOCKER_REGISTRY}/${NAMESPACE}/${CIRCLE_PROJECT_REPONAME}:latest" --build-arg CIRCLE_SHA1="${CIRCLE_SHA1}" --build-arg SENTRY_DSN="${SENTRY_DSN}" --build-arg GA_UA="${GA_UA}" --build-arg CIRCLE_PROJECT_REPONAME="${CIRCLE_PROJECT_REPONAME}" --build-arg CIRCLE_BRANCH="${CIRCLE_BRANCH}" --build-arg CIRCLE_REPOSITORY_URL="${CIRCLE_REPOSITORY_URL}" --build-arg WEBHOOK_URL="${WEBHOOK_URL}" --build-arg GOOGLE_MAPS_KEY="${GOOGLE_MAPS_KEY}" --build-arg AIRTABLE_WRITE_KEY="${AIRTABLE_WRITE_KEY}" .
docker push "${DOCKER_REGISTRY}/${NAMESPACE}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_SHA1}"
docker push "${DOCKER_REGISTRY}/${NAMESPACE}/${CIRCLE_PROJECT_REPONAME}:latest"
name: "Build and Deploy API Docker Image"
- run:
command: ~/repo/.circleci/notify_failure.sh
name: "Report failing Master"
when: on_fail
working_directory: ~/repo
update_ecs:
docker:
- image: "cdssnc/ecs-cli:latest"
steps:
- checkout:
path: ~/repo
- setup_remote_docker
- run:
command: |
cd deploy
ecs-cli compose --file docker-compose.yml --ecs-params ecs-params.yml --cluster staging-ecs-cluster --project-name staging-vac-poc service up --launch-type FARGATE --timeout 15
name: "Update ECS Task"
- run:
command: ~/repo/.circleci/notify_failure.sh
name: "Report failing Master"
when: on_fail
working_directory: ~/repo
workflows:
version: 2
build_and_deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only:
- master