forked from NREL/REopt_API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-undeploy-c110p
48 lines (42 loc) · 980 Bytes
/
Jenkinsfile-undeploy-c110p
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
37
38
39
40
41
42
43
44
45
46
47
48
@Library("tada-jenkins-library") _
properties([
parameters([
string(
name: "PARAM_BRANCHES",
description: "Enter a space-deliminted list of branches you wish to undeploy."
),
])
])
pipeline {
agent {
docker {
image "ruby:2.7.2-buster"
}
}
options {
disableConcurrentBuilds()
}
environment {
C110P_URL = credentials("reopt-api-c110p-url")
XPRESSDIR = "/opt/xpressmp"
PARAM_STAGE = "internal_c110p"
}
stages {
stage("undeploy") {
steps {
script {
currentBuild.description = "Stage: $PARAM_STAGE Branches: $PARAM_BRANCHES"
sh "bundle install"
sshagent(credentials: ["jenkins-ssh"]) {
sh "for branch_name in ${PARAM_BRANCHES}; do bundle exec cap ${PARAM_STAGE} undeploy --trace BRANCH=\$branch_name CONFIRM_UNDEPLOY=true DEBUG_DEPLOY=true; done"
}
}
}
}
}
post {
always {
tadaSendNotifications()
}
}
}