-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
37 lines (33 loc) · 991 Bytes
/
.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
image: golang:1.13-stretch
stages:
- test
- build
before_script:
- which ssh || ( apt-get update -y && apt-get install openssh-client rsync -y )
- mkdir -p ~/.ssh
- echo "$ADSDEPLOY_PRIVATE_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
test:
stage: test
tags:
- docker
script:
- go list -e $(go list -f '{{.Path}}' -m all 2>/dev/null)
- go test -timeout 300s ./...
build:
stage: build
tags:
- docker
script:
- git remote show origin
- git remote set-url --push origin git@github.com:webediads/adsgolib.git
- git remote show origin
- git config --global user.email "adserver@webedia-group.com"
- git config --global user.name "adsdeploy from gitlab"
- git tag $(cat ./version)
- git push --tags origin HEAD:$CI_COMMIT_REF_NAME
- git push -f --follow-tags origin HEAD:$CI_COMMIT_REF_NAME
only:
refs:
- master