-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
71 lines (62 loc) · 1.44 KB
/
.gitlab-ci.yml
File metadata and controls
71 lines (62 loc) · 1.44 KB
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
stages:
- init
- test
- build
- run
before_script:
- export GOROOT="/usr/local/go"
- export GOPATH="/home/gitlab-runner/go"
- export PATH="$PATH:$GOROOT/bin:$GOPATH/bin"
- export GOPROXY=direct
- export Branch_Name="$CI_COMMIT_REF_NAME"
- export Serivce_Name="violin-scheduler"
- export Build_Path="/home/gitlab-runner/tmp_build"
copy_dir:
stage: init
script:
- make copy_dir
- ln -sf $GOPATH/src/hcc/pb ../pb
unit_tests:
stage: test
script:
- make test
race_detector:
stage: test
script:
- make race
code_coverage:
stage: test
script:
- make coverage
# only:
# - master
go_report:
stage: test
script:
- make goreport
# only:
# - master
# lint_code:
# stage: test
# script:
# - make lint_dep
# - make lint
build:
stage: build
script:
- make
- if [[ ! -d "$Build_Path/$Serivce_Name/$Branch_Name" ]]; then mkdir -p $Build_Path/$Serivce_Name/$Branch_Name;fi
- cp -f $PWD/$Serivce_Name $Build_Path/$Serivce_Name/$Branch_Name/
- echo "Build Complete"
service_run:
stage: run
script:
- sudo /usr/sbin/service $Serivce_Name stop
- sudo cp $Build_Path/$Serivce_Name/$Branch_Name/$Serivce_Name /usr/local/bin/$Serivce_Name
- sudo chmod 755 /usr/local/bin/$Serivce_Name
- sudo /usr/sbin/service $Serivce_Name start
- sudo rm -rf $Build_Path/$Serivce_Name/$Branch_Name
- echo "Finished"
only:
- master
- feature/dev