This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
forked from bitly/oauth2_proxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
85 lines (75 loc) · 1.82 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# This file is a template, and might need editing before it works on your project.
# Official docker image.
image: golang:latest
variables:
FAILFASTCI_NAMESPACE: jj-ff
GOLANG_DEP_VER: 0.4.1
GO_SRC_PATH: github.com/joejulian/oauth2_proxy
stages:
- test
- build
- publish
services:
- docker:dind
test-fmt:
stage: test
image: golang
tags:
- gitlab-org
script:
- go fmt
test-vet:
stage: test
image: golang
tags:
- gitlab-org
script:
- curl -L -s https://github.com/golang/dep/releases/download/v${GOLANG_DEP_VER}/dep-linux-amd64 -o $GOPATH/bin/dep
- chmod +x $GOPATH/bin/dep
- mkdir -p $(dirname $GOPATH/src/${GO_SRC_PATH})
- ln -sf $PWD $GOPATH/src/${GO_SRC_PATH}
- cd $GOPATH/src/${GO_SRC_PATH}
- dep ensure
- go vet
test:
stage: test
image: golang
tags:
- gitlab-org
script:
- curl -L -s https://github.com/golang/dep/releases/download/v${GOLANG_DEP_VER}/dep-linux-amd64 -o $GOPATH/bin/dep
- chmod +x $GOPATH/bin/dep
- mkdir -p $(dirname $GOPATH/src/${GO_SRC_PATH})
- ln -sf $PWD $GOPATH/src/${GO_SRC_PATH}
- cd $GOPATH/src/${GO_SRC_PATH}
- dep ensure
- go test
build:
stage: build
image: golang
tags:
- gitlab-org
script:
- go build
build-master:
stage: publish
image: docker:latest
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker push "$CI_REGISTRY_IMAGE"
only:
- master
tags:
- docker
build:
stage: publish
image: docker:latest
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
except:
- master
tags:
- docker