-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
36 lines (32 loc) · 1.03 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
#!/usr/bin/groovy
@Library('github.com/fabric8io/fabric8-pipeline-library@master')
def utils = new io.fabric8.Utils()
def repo = 'caddy-image'
def org = 'fabric8io-images'
dockerTemplate{
clientsNode{
checkout scm
if (utils.isCI()){
echo 'No CI tests to run'
} else if (utils.isCD()){
echo 'Running CD pipeline'
sh "git remote set-url origin [email protected]:${org}/${repo}.git"
def newVersion = getNewVersion {}
stage 'tag'
container('clients') {
gitTag{
releaseVersion = newVersion
skipVersionPrefix = true
}
}
container('docker') {
stage ('build'){
sh "docker build -t fabric8/caddy:${newVersion} ."
}
stage ('push to dockerhub'){
sh "docker push fabric8/caddy:${newVersion}"
}
}
}
}
}