forked from ernoaapa/eliot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
125 lines (108 loc) · 1.96 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
image: golang:1.10-stretch
variables:
REPO_NAME: github.com/ernoaapa/eliot
stages:
- test
- build
- publish
before_script:
- go version
# Move project under $GOPATH
- mkdir -p $GOPATH/src/$(dirname $REPO_NAME)
- ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME
- cd $GOPATH/src/$REPO_NAME
# Configure Docker
- ./build/install-docker.sh
- echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin
# BUILD
build:
stage: build
tags:
- arm64
script:
- ./build/install-build-tools.sh
- goreleaser --snapshot
artifacts:
paths:
- dist/
# TEST
.test: &test
stage: test
script:
- "! go fmt -l pkg cmd 2>&1 | read"
- go vet ./...
- go test -v ./...
test:arm64:
<<: *test
tags:
- arm64
test:armv7:
<<: *test
tags:
- armv7
# PUBLISH
.publish: &publish
stage: publish
only:
- tags
script:
- ./build/install-build-tools.sh
- goreleaser --rm-dist
- build/push-docker-manifest.sh $(git describe --tags --always --dirty)
- |
for package in dist/eliot_*.deb; do
pkgcloud-push ernoaapa/eliot/raspbian/stretch $package
done
artifacts:
paths:
- dist/
publish:arm64:
<<: *publish
tags:
- arm64
variables:
GOARCH: arm64
publish:armv6:
<<: *publish
tags:
- armv6
variables:
GOARCH: arm
GOARM: "6"
publish:armv7:
<<: *publish
tags:
- armv7
variables:
GOARCH: arm
GOARM: "7"
# PUBLISH DEBS
.publish-debs: &publish-debs
stage: publish
script:
- ./build/install-build-tools.sh
- apt-get update && apt-get install -y btrfs-tools libseccomp-dev
- ./deps/publish-all.sh
artifacts:
paths:
- dist/
publish-debs:arm64:
<<: *publish-debs
tags:
- arm64
variables:
GOARCH: arm64
publish-debs:armv6:
<<: *publish-debs
tags:
- armv6
variables:
GOARCH: arm
GOARM: "6"
publish-debs:armv7:
<<: *publish-debs
tags:
- armv7
variables:
GOARCH: arm
GOARM: "7"