Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Commit b16208c

Browse files
committed
Build: Add pipeline script
1 parent 1bd1db7 commit b16208c

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Jenkinsfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!groovy
2+
3+
@Library('github.com/teecke/jenkins-pipeline-library@v3.4.1') _
4+
5+
// Initialize global config
6+
cfg = jplConfig('gp-haproxy', 'docker', '', [email: env.CITEECKE_NOTIFY_EMAIL_TARGETS])
7+
8+
def publishDockerImage() {
9+
nextReleaseNumber = sh (script: "kd get-next-release-number .", returnStdout: true).trim().substring(1)
10+
docker.withRegistry("https://registry.hub.docker.com", 'teeckebot-docker-credentials') {
11+
def customImage = docker.build("teecke/gp-haproxy:${nextReleaseNumber}", "./haproxy")
12+
customImage.push()
13+
customImage.push('latest')
14+
}
15+
}
16+
17+
pipeline {
18+
agent { label 'docker' }
19+
20+
stages {
21+
stage ('Initialize') {
22+
steps {
23+
jplStart(cfg)
24+
}
25+
}
26+
stage ('Bash linter') {
27+
steps {
28+
script {
29+
sh 'devcontrol run-bash-linter'
30+
}
31+
}
32+
}
33+
stage ('Make release') {
34+
when { branch 'release/new' }
35+
steps {
36+
publishDockerImage()
37+
jplMakeRelease(cfg, true)
38+
}
39+
}
40+
}
41+
42+
post {
43+
always {
44+
jplPostBuild(cfg)
45+
}
46+
}
47+
48+
options {
49+
timestamps()
50+
ansiColor('xterm')
51+
buildDiscarder(logRotator(artifactNumToKeepStr: '20',artifactDaysToKeepStr: '30'))
52+
disableConcurrentBuilds()
53+
timeout(time: 10, unit: 'MINUTES')
54+
}
55+
}

0 commit comments

Comments
 (0)