-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.gitlab-ci.yml
34 lines (31 loc) · 867 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
stages:
- build
- image
build_project:
image: golang:latest
stage: build
script:
- go get github.com/constabulary/gb/...
- ln -s /builds /go/src/gitlab.com
- cd /go/src/gitlab.com/${CI_PROJECT_PATH}
- GOOS=linux GOARCH=amd64 CGO=0 gb build -ldflags '-w -s -extldflags "-static"'
- mv bin/server-linux-amd64 bin/server
artifacts:
paths:
- bin/server
cache:
paths:
- bin/server
build_docker_image:
image: jonaskello/docker-and-compose:17.03.0-1.18.0
stage: image
variables:
DOCKER_DRIVER: overlay2
services:
- docker:17.03.0-dind
script:
- cd /builds/${CI_PROJECT_PATH}
- cp /etc/ssl/certs/ca-certificates.crt ca-certificates.crt
- docker login https://${HUB_URL} -u ${HUB_LOGIN} -p ${HUB_PASSWORD}
- docker build -t ${HUB_URL}/godns:latest .
- docker push ${HUB_URL}/godns