forked from influxdata/influxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
96 lines (83 loc) · 2.23 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
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
readTrusted 'Dockerfile_jenkins_ubuntu32'
pipeline {
agent none
stages {
stage('Update changelog') {
agent any
when {
anyOf {
branch 'master'
expression { BRANCH_NAME ==~ /^\d+(.\d+)*$/ }
}
}
steps {
sh "docker pull jsternberg/changelog"
withDockerContainer(image: "jsternberg/changelog") {
withCredentials(
[[$class: "UsernamePasswordMultiBinding",
credentialsId: "hercules-username-password",
usernameVariable: "GITHUB_USER",
passwordVariable: "GITHUB_TOKEN"]]) {
script {
if (env.GIT_PREVIOUS_SUCCESSFUL_COMMIT) {
sh "git changelog ${env.GIT_PREVIOUS_SUCCESSFUL_COMMIT}"
} else {
sh "git changelog"
}
}
}
}
sshagent(credentials: ['jenkins-hercules-ssh']) {
sh """
set -e
if ! git diff --quiet; then
git config remote.origin.pushurl [email protected]:influxdata/influxdb.git
git commit -am 'Update changelog'
git push origin HEAD:${BRANCH_NAME}
fi
"""
}
}
}
stage('64bit') {
agent {
docker {
image 'golang:1.11'
}
}
steps {
sh """
mkdir -p /go/src/github.com/influxdata
cp -a $WORKSPACE /go/src/github.com/influxdata/influxdb
cd /go/src/github.com/influxdata/influxdb
go get github.com/golang/dep/cmd/dep
dep ensure -vendor-only
"""
sh """
cd /go/src/github.com/influxdata/influxdb
go test -parallel=1 ./...
"""
}
}
stage('32bit') {
agent {
dockerfile {
filename 'Dockerfile_jenkins_ubuntu32'
}
}
steps {
sh """
mkdir -p /go/src/github.com/influxdata
cp -a $WORKSPACE /go/src/github.com/influxdata/influxdb
cd /go/src/github.com/influxdata/influxdb
go get github.com/golang/dep/cmd/dep
dep ensure -vendor-only
"""
sh """
cd /go/src/github.com/influxdata/influxdb
go test -parallel=1 ./...
"""
}
}
}
}