-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
60 lines (56 loc) · 1.65 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
stages:
- test
- build
- deploy
unit-test:
stage: test
image: golang:1.15
before_script:
- cd $CI_PROJECT_DIR
- go mod tidy
script: make test
build-server:
stage: build
image: golang:1.15
before_script:
- cd $CI_PROJECT_DIR
- go mod tidy
script: make engine
deploy-heroku-master:
stage: deploy
image: docker:latest
only:
- master
services:
- docker:dind
before_script:
- cd $CI_PROJECT_DIR
variables:
DOCKER_DRIVER: overlay
script:
- echo $HEROKU_TOKEN
- docker build -f Dockerfile --iidfile imageid.txt -t registry.heroku.com/sea-store-backend-transactions/web .
- docker login -u _ -p $HEROKU_TOKEN registry.heroku.com
- docker push registry.heroku.com/sea-store-backend-transactions/web
- apk add --no-cache curl bash
- echo "Docker Image ID is $(cat imageid.txt)"
- bash herokuapi.sh https://api.heroku.com/apps/sea-store-backend-transactions/formation $(cat imageid.txt) $HEROKU_TOKEN
deploy-heroku-staging:
stage: deploy
image: docker:latest
except:
- master
services:
- docker:dind
before_script:
- cd $CI_PROJECT_DIR
variables:
DOCKER_DRIVER: overlay
script:
- echo $HEROKU_TOKEN
- docker build -f Dockerfile --iidfile imageid.txt -t registry.heroku.com/sea-store-be-transactions-stg/web .
- docker login -u _ -p $HEROKU_TOKEN registry.heroku.com
- docker push registry.heroku.com/sea-store-be-transactions-stg/web
- apk add --no-cache curl bash
- echo "Docker Image ID is $(cat imageid.txt)"
- bash herokuapi.sh https://api.heroku.com/apps/sea-store-be-transactions-stg/formation $(cat imageid.txt) $HEROKU_TOKEN