forked from veepee-oss/influxdb-relay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
78 lines (66 loc) · 1.55 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
---
# https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
stages:
- linter
- build
- test
- pages
# linter
dockerlint:
stage: linter
image: vpgrp/linter:docker
script:
- find . -type f -name "Dockerfile" | grep -v 'vendor' | xargs -I{} dockerlint {}
golint:
stage: linter
image: vpgrp/linter:golang
before_script:
- go get github.com/GeertJohan/fgt
script:
- find . -type f -name "*\.go" | grep -v 'vendor' | xargs -I{} fgt golint {}
# build
docker-build:
stage: build
image: docker:latest
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay
script:
- docker build --rm .
go-build:
stage: build
image: vpgrp/golang:latest
before_script:
- mkdir -p ${GOPATH}/src/github.com/strike-team
- ln -fsv ${CI_PROJECT_DIR} ${GOPATH}/src/github.com/strike-team/influxdb-relay
script:
- cd ${GOPATH}/src/github.com/strike-team/influxdb-relay
- go get
- go build -a -ldflags '-extldflags "-static"' -o influxdb-relay
# tests
go-tests:
stage: test
image: vpgrp/golang
before_script:
- mkdir -p ${GOPATH}/src/github.com/strike-team
- ln -fsv ${CI_PROJECT_DIR} ${GOPATH}/src/github.com/strike-team/influxdb-relay
- go get github.com/stretchr/testify/assert
script:
- cd ${GOPATH}/src/github.com/strike-team/influxdb-relay
- go get
- go test ./...
# vpage
pages:
stage: pages
tags:
- docker
image: vptech/vpages:latest
script:
- env REPO_NAME=$CI_PROJECT_NAME build-pages
artifacts:
paths:
- public
only:
- add-vpage
# EOF