-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
57 lines (54 loc) · 1.84 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
stages:
- test
- build
test:
stage: test
image: golang:stretch
script:
- git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/".insteadOf "https://gitlab.com/"
- git clone -b $CI_COMMIT_REF_NAME $CI_REPOSITORY_URL $GOPATH/src/modulus/$CI_PROJECT_NAME
- git clone https://gitlab.com/lambospeed/licensing-client.git $GOPATH/src/modulus/common/licensing-client
- go get -d -v ./...
- go get gopkg.in/jarcoal/httpmock.v1 github.com/onsi/ginkgo/ginkgo github.com/onsi/gomega/... github.com/stretchr/testify
- cd $GOPATH/src/modulus/$CI_PROJECT_NAME
- go test -cover ./...
build:
stage: build
image: golang:alpine
before_script:
- apk add --no-cache git
script:
- git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/".insteadOf "https://gitlab.com/"
- git clone -b $CI_COMMIT_REF_NAME $CI_REPOSITORY_URL $GOPATH/src/modulus/$CI_PROJECT_NAME
- git clone https://gitlab.com/lambospeed/licensing-client.git $GOPATH/src/modulus/common/licensing-client
- go get -d -v ./...
- cd main
- go build -o kyc
- mv kyc kyc.cfg ../
artifacts:
paths:
- kyc
- kyc.cfg
only:
- master
build:prod:windows:
stage: build
image: golang:alpine
before_script:
- apk add --no-cache git
script:
- git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/".insteadOf "https://gitlab.com/"
- git clone -b $CI_COMMIT_REF_NAME $CI_REPOSITORY_URL $GOPATH/src/modulus/$CI_PROJECT_NAME
- git clone https://gitlab.com/lambospeed/licensing-client.git $GOPATH/src/modulus/common/licensing-client
- go get -d -v ./...
- cd main
- env GOOS=windows GOARCH=amd64 go build -ldflags "-X main.DevEnv=false" -o kyc.exe -v
- cp kyc.exe ../
- cp kyc.cfg ../
artifacts:
name: "kyc-prod-win"
paths:
- kyc.exe
- kyc.cfg
only:
- master