forked from bcgov/gcpe-news-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-master
36 lines (32 loc) · 908 Bytes
/
Jenkinsfile-master
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
node('master') {
stage('Build Image') {
openshift.withCluster() {
openshift.withProject() {
echo "building..."
def bc = openshift.selector('bc', 'news-webapp-master')
def buildSelector = bc.startBuild()
sleep(2)
buildSelector.logs('-f')
sleep(2)
openshift.tag("news-webapp-master:latest", "news-webapp:prod")
openshift.tag("news-webapp-master:latest", "news-webapp:uat")
}
}
}
stage('Deploy to UAT') {
openshift.withCluster() {
openshift.withProject("47ba99-test") {
echo "Deploying to uat..."
openshift.selector("dc", "news-webapp-uat").rollout().latest()
}
}
}
stage('Deploy on Prod') {
input "Deploy to prod?"
openshift.withCluster() {
openshift.withProject("47ba99-prod") {
openshift.selector("dc", "news-webapp").rollout().latest()
}
}
}
}