Minor cleanup

This commit is contained in:
Ovidio Mallo 2016-12-08 00:28:53 +01:00
parent 3087cf5f0d
commit 5cf826925c

View file

@ -1,11 +1,16 @@
def ocCmd = "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"
def getOcCmd() {
return "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"
}
def getReplicasOpt(deploymentConfig, project) {
def ocCmd = getOcCmd()
def replicas = sh(script: "${ocCmd} get dc ${deploymentConfig} --template='{{ .spec.replicas }}' -n ${project}", returnStdout: true).trim()
return replicas ? "-v REPLICAS=${replicas}" : ""
}
node() {
def ocCmd = getOcCmd()
def buildConfigFile = "deployment/config/build.yaml"
def appConfigFile = "deployment/config/app.yaml"