-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
104 lines (104 loc) · 2.41 KB
/
.gitlab-ci.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
image: circleci/elixir:1.11.3-node-browsers
services:
- postgres:12.5-alpine
variables:
GIT_DEPTH: 0
GIT_STRATEGY: clone
POSTGRES_DB: epiviewpoint_test
POSTGRES_HOST: postgres
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
stages:
- test
- deploy
before_script:
- echo -n $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
test:
cache:
key:
files:
- mix.lock
- assets/package-lock.json
prefix: v1
paths:
- deps
- assets/node_modules
- _build
before_script:
- npm install --prefix assets
- mix local.rebar --force
- mix local.hex --force
- mix deps.get
- mix deps.unlock --check-unused
- mix deps.audit
- npm audit --audit-level=moderate --prefix assets
- mix sobelow --config
stage: test
script:
- bin/dev/test
variables:
MIX_ENV: test
build_image:
stage: test
only:
- main
image: geometer/docker-gcp:latest
services:
- docker:dind
script:
- bin/docker/build
deploy_staging:
only:
- main
stage: deploy
image: geometer/docker-gcp:latest
services:
- docker:dind
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA epiviewpoint:latest
- bin/remote/deploy staging
resource_group: staging
environment:
name: staging
url: https://viewpoint.staging.gsi.dev
deploy_construction:
only:
- main
stage: deploy
image: geometer/docker-gcp:latest
services:
- docker:dind
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA epiviewpoint:latest
- bin/remote/deploy construction
resource_group: construction
environment:
name: construction
url: https://viewpoint.construction.gsi.dev
when: manual
deploy_demo:
only:
- main
stage: deploy
image: geometer/docker-gcp:latest
services:
- docker:dind
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA epiviewpoint:latest
- bin/remote/deploy demo
resource_group: demo
environment:
name: demo
url: https://viewpoint.demo.gsi.dev
when: manual
deploy_heroku:
only:
- main
stage: deploy
script:
- git remote add heroku https://heroku:[email protected]/$HEROKU_APP_STAGING.git || true
- git push -f heroku HEAD:master