Update the OpenShift configs during the build pipeline
This commit is contained in:
parent
9a3f154c96
commit
c458296ff9
1 changed files with 6 additions and 0 deletions
|
@ -1,11 +1,16 @@
|
||||||
node() {
|
node() {
|
||||||
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 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 buildConfigUrl = "https://raw.githubusercontent.com/omallo/ruby-ex/master/deployment/config/build.yaml"
|
||||||
|
def appConfigUrl = "https://raw.githubusercontent.com/omallo/ruby-ex/master/deployment/config/app.yaml"
|
||||||
|
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
|
sh "${ocCmd} process -f ${buildConfigUrl} | ${ocCmd} apply -f -"
|
||||||
sh "${ocCmd} start-build frontend -w -n rubex-dev"
|
sh "${ocCmd} start-build frontend -w -n rubex-dev"
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Deploy to DEV') {
|
stage('Deploy to DEV') {
|
||||||
|
sh "${ocCmd} process -f ${appConfigUrl} -v ENV=dev | ${ocCmd} apply -f -"
|
||||||
sh "${ocCmd} tag rubex-dev/frontend:latest rubex-dev/frontend:dev"
|
sh "${ocCmd} tag rubex-dev/frontend:latest rubex-dev/frontend:dev"
|
||||||
sh "${ocCmd} deploy frontend --latest --follow -n rubex-dev"
|
sh "${ocCmd} deploy frontend --latest --follow -n rubex-dev"
|
||||||
}
|
}
|
||||||
|
@ -17,6 +22,7 @@ node() {
|
||||||
|
|
||||||
if (isPromoteToTest) {
|
if (isPromoteToTest) {
|
||||||
stage('Deploy to TEST') {
|
stage('Deploy to TEST') {
|
||||||
|
sh "${ocCmd} process -f ${appConfigUrl} -v ENV=test | ${ocCmd} apply -f -"
|
||||||
sh "${ocCmd} tag rubex-dev/frontend:dev rubex-dev/frontend:test"
|
sh "${ocCmd} tag rubex-dev/frontend:dev rubex-dev/frontend:test"
|
||||||
sh "${ocCmd} deploy frontend --latest --follow -n rubex-test"
|
sh "${ocCmd} deploy frontend --latest --follow -n rubex-test"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue