-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
39 lines (33 loc) · 1.26 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
podTemplate(label: 'sample-go', containers: [
containerTemplate(name: 'jnlp', image: 'jenkinsci/jnlp-slave:2.62-alpine', args: '${computer.jnlpmac} ${computer.name}'),
containerTemplate(name: 'golang', image: 'golang:1.7.5', ttyEnabled: true, command: 'cat'),
containerTemplate(name: 'docker', image: 'docker', command: 'cat', ttyEnabled: true)
], volumes: [
hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock'),
secretVolume(mountPath: '/home/jenkins/.docker/', secretName: 'coffeepac-quay-robot-dockercfg')
]) {
node('sample-go') {
container('golang'){
stage('checkout') {
git url: 'https://github.com/coffeepac/sample-go'
}
stage('build') {
sh 'go build -v'
}
stage('the hell mk II') {
sh 'ls $HOME; ls ~'
}
stage('test') {
sh 'go test -v'
}
}
container('docker') {
stage('docker build') {
sh 'docker build -t quay.io/coffeepac/sample-go:jenkins .'
}
stage('docker push') {
sh 'docker push quay.io/coffeepac/sample-go:jenkins'
}
}
}
}