-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
48 lines (43 loc) · 895 Bytes
/
.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
image: golang:1.13
stages:
- build
- test
- deploy
build:
stage: build
script:
- go build -o recs-api
test:
stage: test
script:
- make test
deploy:
image: docker:stable
stage: deploy
services:
- docker:19.03.0-dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
only:
refs:
- tags
script:
- export VERSION=$(cat ./VERSION)
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- docker build -t pococknick91/recs-api:$VERSION .
- docker tag pococknick91/recs-api:$VERSION pococknick91/recs-api:latest
- echo "=> Pushing pococknick91/recs-api:$VERSION to docker"
- docker push pococknick91/recs-api
tags:
- docker
release:
stage: deploy
only:
refs:
- tags
script:
- export GITHUB_TOKEN="$GITHUB_GORELEASER"
- curl -sL https://git.io/goreleaser | bash
tags:
- docker