Extend the pipeline to explicitly trigger deployments
This commit is contained in:
parent
35e09f59dc
commit
abb1d8350c
1 changed files with 16 additions and 4 deletions
|
@ -1,6 +1,16 @@
|
||||||
def oc(args) {
|
def oc(args) {
|
||||||
def ocCmd = "/tmp/oc2 --token=`cat /var/run/secrets/kubernetes.io/serviceaccount/token` --server=https://openshift.default.svc.cluster.local --certificate-authority=/run/secrets/kubernetes.io/serviceaccount/ca.crt"
|
sh getOcCmd(args)
|
||||||
sh "${ocCmd} " + args
|
}
|
||||||
|
|
||||||
|
def ocPipe(args1, args2) {
|
||||||
|
def ocCmd1 = getOcCmd(args1)
|
||||||
|
def ocCmd2 = getOcCmd(args2)
|
||||||
|
sh "${ocCmd1} | ${ocCmd2}"
|
||||||
|
}
|
||||||
|
|
||||||
|
def getOcCmd(args) {
|
||||||
|
def ocBin = "oc --token=`cat /var/run/secrets/kubernetes.io/serviceaccount/token` --server=https://openshift.default.svc.cluster.local --certificate-authority=/run/secrets/kubernetes.io/serviceaccount/ca.crt"
|
||||||
|
return "${ocBin} ${args}"
|
||||||
}
|
}
|
||||||
|
|
||||||
node() {
|
node() {
|
||||||
|
@ -9,7 +19,8 @@ node() {
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Deploy to DEV') {
|
stage('Deploy to DEV') {
|
||||||
// noop
|
oc "tag rubex-dev/frontend:latest rubex-dev/frontend:dev"
|
||||||
|
oc "deploy frontend --latest --follow -n rubex-dev"
|
||||||
}
|
}
|
||||||
|
|
||||||
def isPromoteToTest = false
|
def isPromoteToTest = false
|
||||||
|
@ -19,7 +30,8 @@ node() {
|
||||||
|
|
||||||
if (isPromoteToTest) {
|
if (isPromoteToTest) {
|
||||||
stage('Deploy to TEST') {
|
stage('Deploy to TEST') {
|
||||||
oc "tag rubex-dev/frontend:latest rubex-dev/frontend:test"
|
oc "tag rubex-dev/frontend:dev rubex-dev/frontend:test"
|
||||||
|
oc "deploy frontend --latest --follow -n rubex-test"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue