-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
63 lines (57 loc) · 1.02 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
variables:
PACKAGE_PATH: /go/src/gitlab.com/kafkaesque/operation-monitor
stages:
- lint
- test
- build
- docker
# A hack to make Golang-in-Gitlab happy
.anchors:
- &inject-gopath
mkdir -p $(dirname ${PACKAGE_PATH})
&& ln -s ${CI_PROJECT_DIR} ${PACKAGE_PATH}
&& cd ${PACKAGE_PATH}
lint:
stage: lint
image: golang:1.13
before_script:
- *inject-gopath
script:
- go get -u golang.org/x/lint/golint
- cd src
- golint ./...
- go vet ./...
artifacts:
name: "vendor-$CI_PIPELINE_ID"
paths:
- vendor/
expire_in: 1 hour
test:
stage: test
dependencies:
- lint
image: golang:1.13
before_script:
- *inject-gopath
script:
- cd src
- go test -v ./...
build:
stage: build
dependencies:
- test
image: golang:1.13
before_script:
- *inject-gopath
script:
- cd src
- go build -o pulsar-monitor
docker:
stage: docker
dependencies:
- lint
image: docker:19
services:
- docker:dind
script:
- docker build -t app .