-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
executable file
·63 lines (51 loc) · 1.34 KB
/
Jenkinsfile
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
#!/usr/bin/env groovy
pipeline {
agent any
tools { go '1.21' }
options {
timeout(time: 15, unit: 'MINUTES')
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr:'10'))
skipDefaultCheckout true
}
triggers {
pollSCM('H/5 * * * *')
}
environment {
GO111MODULE = 'on'
CGO_ENABLED = 0
GOPATH = "${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}"
}
stages {
stage('Pre-Clean') {
steps {
deleteDir()
checkout scm
}
}
stage('Install') {
steps {
sh 'go version'
sh 'go get -u golang.org/x/lint/golint'
sh 'go mod download'
}
}
stage('Test') {
steps {
sh 'make test'
}
}
stage("Build apps") {
steps {
echo 'Compiling gateway'
sh 'go build -o gateway cmd/gateway/main.go'
echo 'Compiling auth_service'
sh 'go build -o auth_service cmd/auth_service/main.go'
echo 'Compiling user_service'
sh 'go build -o user_service cmd/user_service/main.go'
echo 'Compiling consumer_service'
sh 'go build -o consumer_service cmd/consumer_service/main.go'
}
}
}
}