-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
67 lines (59 loc) · 1.38 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
image: golang:latest
stages:
- test
- build
- staging
- production
go_test:
stage: test
script:
- go build
# - go test -timeout 30s ./... -run -v -tags "test"
- echo done
repo_push_stage:
stage: build
image: docker:19.03.0
services:
- docker:18.09.7-dind
script:
- docker login --username=_ --password=${HEROKU_API_KEY} ${REGISTRY_URL}
- docker build -t ${APP_STAGE} .
- docker tag "${APP_STAGE}:latest" ${REGISTRY_URL}/${APP_STAGE}/web
- docker push ${REGISTRY_URL}/${APP_STAGE}/web
only:
- master
staging_deploy:
image: node
stage: staging
before_script:
- npm install -g heroku
script:
- heroku container:release web -a ${APP_STAGE}
only:
- master
repo_push:
stage: build
image: docker:19.03.0
services:
- docker:18.09.7-dind
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
# See https://github.com/docker-library/docker/pull/166
DOCKER_TLS_CERTDIR: ""
script:
- docker login --username=_ --password=${HEROKU_API_KEY} ${REGISTRY_URL}
- docker build -t ${APP} .
- docker tag "${APP}:latest" ${REGISTRY_URL}/${APP}/web
- docker push ${REGISTRY_URL}/${APP}/web
only:
- tags
production_deploy:
image: node
stage: production
before_script:
- npm install -g heroku
script:
- heroku container:release web -a ${APP}
only:
- tags