-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
44 lines (40 loc) · 1.3 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
image: registry.gitlab.com/yakshaving.art/go-builder:0.0.1
stages:
- build
- release
variables:
CGO_ENABLED: 0
build:
stage: build
coverage: '/^total:\s+\(statements\)\s+(\d+.\d+)%$/'
cache:
paths:
- vendor
artifacts:
paths:
- git-pull-mirror
script:
- mkdir -p /go/src/gitlab.com/${CI_PROJECT_NAMESPACE}
- cd /go/src/gitlab.com/${CI_PROJECT_NAMESPACE}
- ln -s ${CI_PROJECT_DIR}
- cd /go/src/gitlab.com/${CI_PROJECT_PATH}
- dep ensure
- make test build
docker_image:
stage: release
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.amd64 --destination $CI_REGISTRY_IMAGE:latest
release:
stage: release
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.amd64 --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
only:
- tags