forked from billyteves/ubuntu-dind
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
62 lines (55 loc) · 1.76 KB
/
Copy pathJenkinsfile
File metadata and controls
62 lines (55 loc) · 1.76 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
#!groovy
@Library('github.com/red-panda-ci/jenkins-pipeline-library@v3.1.6') _
// Initialize global config
cfg = jplConfig('ubuntu-dind', 'docker', '', [slack: '#integrations', email:'redpandaci+ubuntudind@gmail.com'])
def publishDockerImages() {
sh "docker rmi redpandaci/ubuntu-dind:test redpanda-ci/ubuntu-dind:latest redpandaci/ubuntu-dind:16.04 || true"
jplDockerPush (cfg, "redpandaci/ubuntu-dind", "16.04", "", "https://registry.hub.docker.com", "redpandaci-docker-credentials")
jplDockerPush (cfg, "redpandaci/ubuntu-dind", "latest", "", "https://registry.hub.docker.com", "redpandaci-docker-credentials")
}
pipeline {
agent none
stages {
stage ('Initialize') {
agent { label 'docker' }
steps {
jplStart(cfg)
}
}
stage ('Build') {
agent { label 'docker' }
steps {
script {
docker.build('redpandaci/ubuntu-dind:test', '.')
}
}
}
stage ('Test') {
agent { label 'docker' }
steps {
sh 'bin/test.sh'
}
}
stage ('Make release'){
// -------------------- automatic release -------------------
agent { label 'docker' }
when { branch 'release/new' }
steps {
publishDockerImages()
jplMakeRelease(cfg, true)
}
}
}
post {
always {
jplPostBuild(cfg)
}
}
options {
timestamps()
ansiColor('xterm')
buildDiscarder(logRotator(artifactNumToKeepStr: '20',artifactDaysToKeepStr: '30'))
disableConcurrentBuilds()
timeout(time: 1, unit: 'DAYS')
}
}