This repository has been archived by the owner on May 22, 2020. It is now read-only.
forked from caddyserver/caddy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
69 lines (60 loc) · 2.13 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
variables:
BUILD_SOURCE: "https://hub.blitznote.com/mark/caddy/builds"
stages:
- test
- build
cache:
key: "go/$CI_BUILD_REF_NAME"
paths:
- _vendor-cache/
.go_depends_template: &get_dependencies
before_script:
- cat for-gopkg.in.crt >>/etc/ssl/certs/ca-certificates.crt
- mkdir -p _vendor-cache /var/go/ours
- ln -s "$(pwd -P)/_vendor-cache" /var/go/theirs
- export GOPATH=/var/go/theirs:/var/go/ours
- grep -q -F "443/tcp" /etc/services || printf "https\t\t443/tcp\n" >>/etc/services
- export CADDYDIR=/var/go/ours/src/github.com/mholt/caddy
- mkdir -p "$(dirname "$CADDYDIR")"
- ln -sfv "$(pwd -P)" "$CADDYDIR"
- cd "$CADDYDIR"
- go get -d -t
- mv /var/go/theirs/src/{blitznote.com,plugin.hosting} /var/go/ours/src/ || true
- tree /var/go -d -l -L 5 || true
- find /var/go/ours/src -mindepth 3 -maxdepth 3 -type d -exec bash -c "cd {}; git log -n 1 --date=relative --pretty=format:'%h - %s (%cr)'" \;
- find /var/go/theirs/src -mindepth 3 -maxdepth 3 -type d -exec bash -c "cd {}; git log -n 1 --date=relative --pretty=format:'%h - %s (%cr)'" \;
vet:
stage: test
<<: *get_dependencies
script:
- diff <(echo -n) <(gofmt -s -d $(find . -type f -name '*.go' -not -path "./_*"))
- go vet ./...
lint:
stage: test
<<: *get_dependencies
script:
- /var/go/provided/bin/ineffassign .
- /var/go/provided/bin/golint ./...
unittests:
stage: test
<<: *get_dependencies
script:
- rm -r dist
- go test -v ./...
build_binary:
stage: build
<<: *get_dependencies
only:
- next
script:
- cp -a build.bash build2.bash
- sed -i -e '/# List of modified/,/ldflags+=/d' build2.bash
- sed -i -e '/Served with/c\ \t\t\tServed with <a rel="noopener noreferrer" href="https://github.com/wmark/caddy">Mark's fork of Caddy</a>.' caddy/setup/browse.go
- ./build2.bash ecaddy~$(dpkg --print-architecture)
- ./ecaddy~$(dpkg --print-architecture) -version
- tar --label "${BUILD_SOURCE}" --owner=root --group=root -cf ecaddy-${CI_BUILD_REF_NAME}.tar ecaddy~$(dpkg --print-architecture)
- plzip ecaddy-${CI_BUILD_REF_NAME}.tar
- rm ecaddy~$(dpkg --print-architecture)
artifacts:
paths:
- ecaddy*