diff --git a/deployment/pipeline.groovy b/deployment/pipeline.groovy index 53d3881..1165794 100644 --- a/deployment/pipeline.groovy +++ b/deployment/pipeline.groovy @@ -1,6 +1,16 @@ 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 "${ocCmd} " + args + sh getOcCmd(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() { @@ -9,7 +19,8 @@ node() { } 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 @@ -19,7 +30,8 @@ node() { if (isPromoteToTest) { 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" } } }