-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfig.yml
143 lines (136 loc) · 4.94 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
135
136
137
138
139
140
141
142
143
version: 2
jobs:
build_backend:
machine:
docker_layer_caching: true
steps:
- checkout
- run:
name: Install Docker Compose
command: |
curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/local/bin/docker-compose
- run:
name: Create env file
command: |
touch .env
echo 'POSTGRES_URL=postgres://postgres:[email protected]:5432/network_adequacy' >> .env
echo 'POSTGRES_URL_POSTGRES=postgres://postgres:[email protected]:5432/postgres' >> .env
echo "GEOCODIO_KEY=$GEOCODIO_KEY" >> .env
- run:
name: Build containers
command: |
docker-compose -f docker-compose.yml -f docker-compose.override.db.yml build backend
- run:
name: Run linters
command: |
make backend-lint
- run:
name: Run tests
command: |
make backend-coverage-ci
build_frontend:
machine:
docker_layer_caching: true
steps:
- checkout
- run:
name: Install Docker Compose
command: |
curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/local/bin/docker-compose
- run:
name: Create env file
command: |
touch .env
- run:
name: Build containers
command: 'docker-compose build frontend'
- run:
name: Run tests
command: |
make frontend-test
deploy-qa:
machine:
docker_layer_caching: true
steps:
- run:
name: Perform update over SSH
command: |
ssh ec2-user@$QA_DNS '
cd tds
docker-compose down
# sudo rm .cache/*
git fetch origin
git checkout .
git checkout deploy-qa
git pull origin deploy-qa
docker-compose -f docker-compose.yml -f docker-compose.override.db.yml build --no-cache backend frontend;
docker-compose -f docker-compose.yml -f docker-compose.remote.yml up -d backend frontend
'
deploy-demo:
machine:
docker_layer_caching: true
steps:
- run:
name: Perform update over SSH
command: |
ssh ec2-user@$DEMO_DNS '
cd tds
docker-compose down
# sudo rm .cache/*
git fetch origin
git checkout .
git checkout deploy-demo
git pull origin deploy-demo
docker-compose -f docker-compose.yml -f docker-compose.override.db.yml build --no-cache backend frontend;
docker-compose -f docker-compose.yml -f docker-compose.remote.yml up -d backend frontend
'
workflows:
version: 2
build:
jobs: # TODO figure out why `ignore` doesn't work.
- build_backend:
filters:
branches:
ignore: /deploy-/
- build_frontend:
filters:
branches:
ignore: /deploy-/
build-deploy-qa:
jobs:
- build_backend:
filters:
branches:
only: deploy-qa
- build_frontend:
filters:
branches:
only: deploy-qa
- deploy-qa:
requires:
- build_backend
- build_frontend
filters:
branches:
only: deploy-qa
build-deploy-demo:
jobs:
- build_backend:
filters:
branches:
only: deploy-demo
- build_frontend:
filters:
branches:
only: deploy-demo
- deploy-demo:
requires:
- build_backend
- build_frontend
filters:
branches:
only: deploy-demo