-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.yml
112 lines (104 loc) · 3.19 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
version: 2.1
workflows:
api:
jobs:
- test-api
- deploy-api:
filters:
branches:
only:
- main
requires:
- test-api
front:
jobs:
- test-front
- deploy-front:
filters:
branches:
only:
- main
requires:
- test-front
jobs:
test-api:
working_directory: ~/shiftdataportal/server
docker:
- image: cimg/node:20.11
steps:
- checkout:
path: ~/shiftdataportal
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: install-yarn
command: yarn --frozen-lockfile
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- run:
name: Run Test
command: yarn test
- run:
name: Run typescript which is the same as running a build
command: yarn tsc
deploy-api:
working_directory: ~/shiftdataportal
resource_class: small
docker:
- image: cimg/base:2023.10
steps:
- checkout:
path: ~/shiftdataportal
- run:
name: Add Scalingo to known_hosts
command: mkdir -p ~/.ssh && ssh-keyscan -H ssh.osc-fr1.scalingo.com >> ~/.ssh/known_hosts
- run:
name: Deploy on Scalingo
command: |
# this folder is huge. It must be removed to avoid the deployment to crash
git rm -r data-preparation/
git config --global user.email "[email protected]"
git config --global user.name "nobody"
git commit -m "remove data-preparation folder"
git push -f [email protected]:data-portal-back.git ${CIRCLE_BRANCH}:main
test-front:
working_directory: ~/shiftdataportal/client
docker:
- image: cimg/node:20.11
steps:
- checkout:
path: ~/shiftdataportal
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: install-yarn
command: yarn --frozen-lockfile
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- run:
name: Run typescript which is the same as running a build
command: yarn build
deploy-front:
working_directory: ~/shiftdataportal
resource_class: small
docker:
- image: cimg/base:2023.10
steps:
- checkout:
path: ~/shiftdataportal
- run:
name: Add Scalingo to known_hosts
command: mkdir -p ~/.ssh && ssh-keyscan -H ssh.osc-fr1.scalingo.com >> ~/.ssh/known_hosts
- run:
name: Deploy on Scalingo
command: |
# this folder is huge. It must be removed to avoid the deployment to crash
git rm -r data-preparation/
git config --global user.email "[email protected]"
git config --global user.name "nobody"
git commit -m "remove data-preparation folder"
git push -f [email protected]:data-portal-front.git ${CIRCLE_BRANCH}:main