-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
102 lines (95 loc) · 2.21 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
cache:
paths:
- .cache
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_CERTDIR: "/certs"
before_script:
- mkdir -p .cache
- export GOPATH="$CI_PROJECT_DIR/.cache"
stages:
- test
- smoke-test
- build
- deploy
unit:
image: docker/compose:1.25.0-rc2-alpine
stage: test
except:
- master
variables:
GOPATH: "~"
services:
- docker:19-dind
tags:
- midgard
before_script:
- echo $GOPATH
- apk update
- apk add make curl bash
script:
- make test
lint:
image: golangci/golangci-lint
stage: test
except:
- master
tags:
- midgard
before_script:
- go get mvdan.cc/gofumpt
script:
- make lint-verbose
smoke-test:
stage: smoke-test
image: docker/compose:alpine-1.25.4
services:
- docker:19-dind
tags:
- midgard
artifacts:
when: on_failure
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- ./logs/
before_script:
- apk update
- apk add make git jq curl
- make docker-gitlab-build
- docker tag registry.gitlab.com/thorchain/midgard:latest registry.gitlab.com/thorchain/midgard:mocknet
- git clone --single-branch -b $CI_COMMIT_BRANCH https://gitlab.com/thorchain/thornode.git || git clone --single-branch -b master https://gitlab.com/thorchain/thornode.git
- cd thornode
- test master = $(git rev-parse --abbrev-ref HEAD) && docker pull registry.gitlab.com/thorchain/thornode:mocknet
- make -C build/docker reset-mocknet-standalone
except:
- schedules
environment:
name: develop
script:
- git clone --single-branch -b $CI_COMMIT_BRANCH https://gitlab.com/thorchain/heimdall.git || git clone --single-branch -b master https://gitlab.com/thorchain/heimdall.git
- cd ./heimdall
- make build
- make smoke
after_script:
- ./thornode/scripts/docker_logs.sh
# Build docker image
build-gitlab-docker:
stage: build
image: docker:stable
tags:
- midgard
only:
- master # build mocknet image
- testnet
- chaosnet
- mainnet
services:
- docker:19-dind
before_script:
- apk update
- apk add make git jq curl
- make docker-gitlab-login
script:
- make docker-gitlab-build
- make docker-gitlab-push