-
Notifications
You must be signed in to change notification settings - Fork 65
/
.gitlab-ci.yml
108 lines (97 loc) · 2.23 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
105
106
107
108
default:
image: gcr.io/google.com/cloudsdktool/cloud-sdk:latest
services:
- name: gcr.io/pluralsh/docker:19.03.13-dind
alias: docker
before_script:
- until docker info; do sleep 1; done
retry:
max: 2
when:
- runner_system_failure
variables:
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_TLS_VERIFY: 1
DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"
stages:
- test
- push
- deploy
build:
stage: test
image: gcr.io/pluralsh/circleci/elixir:1.9.4
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- _build
- deps
script:
- wget -O plural.o 'https://app.plural.sh/artifacts/plural/plural?platform=linux&arch=amd64'
- mkdir bin
- chmod +x ./plural.o
- cp ./plural.o ./bin/plural
- curl -L https://get.helm.sh/helm-v3.3.1-linux-amd64.tar.gz | tar xvz
- mv linux-amd64/helm bin/helm && chmod +x bin/helm
- export PATH="$(pwd)/bin:$PATH"
- make testup
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- mix test
.push_globals: &push-globs
before_script:
- until docker info; do sleep 1; done
- gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS
- gcloud auth configure-docker -q
- docker login -u [email protected] -p $PLURAL_ACCESS_TOKEN dkr.plural.sh
build-plural:
stage: push
<<: *push-globs
only:
- master
script:
- make build APP_NAME=plural GIT_COMMIT=$CI_COMMIT_SHORT_SHA
- make push APP_NAME=plural
build-rtc:
stage: push
<<: *push-globs
only:
- master
script:
- make build APP_NAME=rtc GIT_COMMIT=$CI_COMMIT_SHORT_SHA
- make push APP_NAME=rtc
build-cron:
stage: push
<<: *push-globs
only:
- master
script:
- make build APP_NAME=cron GIT_COMMIT=$CI_COMMIT_SHORT_SHA
- make push APP_NAME=cron
build-worker:
stage: push
<<: *push-globs
only:
- master
script:
- make build APP_NAME=worker GIT_COMMIT=$CI_COMMIT_SHORT_SHA
- make push APP_NAME=worker
build-www:
stage: push
<<: *push-globs
only:
- master
script:
- make build APP_NAME=www
- make push APP_NAME=plural-www
deploy:
stage: deploy
only:
- master
image: gcr.io/pluralsh/plrl-base:0.1.9
before_script:
- cat /root/configure.sh
- source /root/configure.sh
script:
- make deploy