Added TODOS for GE 8.6
This commit is contained in:
parent
f3b01722a2
commit
835453322f
1 changed files with 7 additions and 22 deletions
29
books/jenkins/Jenkinsfile
vendored
29
books/jenkins/Jenkinsfile
vendored
|
|
@ -5,11 +5,12 @@ pipeline {
|
|||
}
|
||||
agent {
|
||||
node {
|
||||
label 'nodejs'
|
||||
//TODO: Add label for Node.js jenkins agent
|
||||
}
|
||||
}
|
||||
|
||||
environment {
|
||||
//TODO: Edit these vars as per your env
|
||||
DEV_PROJECT = "youruser-books-dev"
|
||||
STAGE_PROJECT = "youruser-books-stage"
|
||||
APP_GIT_URL = "https://github.com/youruser/DO288-apps"
|
||||
|
|
@ -58,11 +59,7 @@ pipeline {
|
|||
'''
|
||||
|
||||
echo '### Creating a new app in DEV env ###'
|
||||
sh '''
|
||||
oc project ${DEV_PROJECT}
|
||||
oc new-app --name books nodejs:8~${APP_GIT_URL} --build-env npm_config_registry=${NEXUS_SERVER} --context-dir ${APP_NAME}
|
||||
oc expose svc/${APP_NAME}
|
||||
'''
|
||||
//TODO: Create a new app and expose the service
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -103,11 +100,7 @@ pipeline {
|
|||
timeout(time: 60, unit: 'MINUTES') {
|
||||
input message: "Promote to Staging?"
|
||||
}
|
||||
script {
|
||||
openshift.withCluster() {
|
||||
openshift.tag("${DEV_PROJECT}/books:latest", "${STAGE_PROJECT}/books:stage")
|
||||
}
|
||||
}
|
||||
//TODO: Tag the books:latest image stream as books:stage
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -121,11 +114,7 @@ pipeline {
|
|||
'''
|
||||
|
||||
echo '### Creating a new app in Staging ###'
|
||||
sh '''
|
||||
oc project ${STAGE_PROJECT}
|
||||
oc new-app --name books -i books:stage
|
||||
oc expose svc/${APP_NAME}
|
||||
'''
|
||||
//TODO: Create a new app in stage using the books:stage image stream and expose the service
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -137,12 +126,8 @@ pipeline {
|
|||
routeHost = readFile('routehost').trim()
|
||||
|
||||
openshift.withCluster() {
|
||||
openshift.withProject( "${STAGE_PROJECT}" ) {
|
||||
def deployment = openshift.selector("dc", "${APP_NAME}").rollout()
|
||||
openshift.selector("dc", "${APP_NAME}").related('pods').untilEach(1) {
|
||||
return (it.object().status.phase == "Running")
|
||||
}
|
||||
}
|
||||
//TODO: Watch deployment until pod is in 'Running' state
|
||||
|
||||
echo "Deployment to Staging env is complete. Access the app at the URL http://${routeHost}."
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue