-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
49 lines (46 loc) · 1.21 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
stages:
- test
- build
- promote
build_image:
tags:
- docker
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- mkdir -p /kaniko/.docker
- echo $DOCKER_AUTH > /kaniko/.docker/config.json
script:
- /kaniko/executor --destination $CI_REGISTRY/nielsole/kudos/kudos:$CI_COMMIT_SHA --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile
promote_image:
services:
- docker:dind
tags:
- docker
- gce
stage: promote
only:
refs:
- master
- tags
image: docker
before_script:
- mkdir -p $HOME/.docker
- echo $DOCKER_AUTH > $HOME/.docker/config.json
script:
- docker pull $CI_REGISTRY/nielsole/kudos/kudos:$CI_COMMIT_SHA
- docker tag $CI_REGISTRY/nielsole/kudos/kudos:$CI_COMMIT_SHA $CI_REGISTRY/nielsole/kudos/kudos:latest
- docker push $CI_REGISTRY/nielsole/kudos/kudos:latest
- docker tag $CI_REGISTRY/nielsole/kudos/kudos:$CI_COMMIT_SHA $CI_REGISTRY/nielsole/kudos/kudos:$CI_COMMIT_REF_NAME
- docker push $CI_REGISTRY/nielsole/kudos/kudos:$CI_COMMIT_REF_NAME
format:
tags:
- docker
stage: test
image:
name: golang:1.15-alpine
entrypoint: [""]
script:
- gofmt -d -e .