This repository has been archived by the owner on Oct 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Jenkinsfile
72 lines (67 loc) · 2.17 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
#!/usr/bin/env groovy
registry = "eu.gcr.io/kyma-project/incubator"
isRelease = env.TAG_NAME
appVersion = isRelease?env.TAG_NAME:env.BRANCH_NAME
properties([
buildDiscarder(logRotator(numToKeepStr: '30')),
])
pipeline {
agent {
node {
label 'docker'
}
}
stages{
stage("setup")
{
steps {
script {
checkout scm
withCredentials([usernamePassword(credentialsId: 'gcr-kyma-rw', passwordVariable: 'pwd', usernameVariable: 'uname')]) {
sh "docker login -u $uname -p '$pwd' $registry"
}
}
}
}
stage("build bundles")
{
steps{
script {
parallel(
"mqtt-event-bridge": {
execute("mqtt-event-bridge")
},
"api-registration-job":{
execute("api-registration-job")
},
"oauth2server":{
execute("oauth2server")
},
"qualtrics-webhook-registration":{
execute("qualtrics-webhook-registration")
},
"qualtrics-event-gw":{
execute("qualtrics-event-gw")
},
"litmos-event-gw":{
execute("litmos-event-gw")
}
)
}
}
}
}
}
def execute(application){
stage ("build image $application"){
sh "cd $application && docker build -t $application ."
}
stage ("push image $application"){
sh "docker tag $application:latest $registry/$application:$appVersion"
sh "docker push $registry/$application:$appVersion"
if(isRelease){
sh "docker tag $application:latest $registry/$application:latest"
sh "docker push $registry/$application:latest"
}
}
}