-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathmultibranch_pipeline
More file actions
44 lines (44 loc) · 1.3 KB
/
multibranch_pipeline
File metadata and controls
44 lines (44 loc) · 1.3 KB
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
pipeline {
agent any
environment {
APPSYSID = '00f35c601b2b9410fe0165f8bc4bcb06'
BRANCH = "${BRANCH_NAME}"
CREDENTIALS = '18be2029-2e62-4070-8828-dbb3aa39f0f0'
DEVENV = 'https://devinstance.service-now.com/'
TESTENV = 'https://testinstance.service-now.com/'
PRODENV = 'https://prodinstance.service-now.com/'
TESTSUITEID = 'b1ae55eedb541410874fccd8139619fb'
}
stages {
stage('Build') {
when {
not {
branch 'master'
}
}
steps {
snApplyChanges(appSysId: "${APPSYSID}", branchName: "${BRANCH}", url: "${DEVENV}", credentialsId: "${CREDENTIALS}")
snPublishApp(credentialsId: "${CREDENTIALS}", appSysId: "${APPSYSID}", obtainVersionAutomatically: true, url: "${DEVENV}")
}
}
stage('Test') {
when {
not {
branch 'master'
}
}
steps {
snInstallApp(credentialsId: "${CREDENTIALS}", url: "${TESTENV}", appSysId: "${APPSYSID}")
snRunTestSuite(credentialsId: "${CREDENTIALS}", url: "${TESTENV}", testSuiteSysId: "${TESTSUITEID}", withResults: true)
}
}
stage('Deploy to Prod') {
when {
branch 'master'
}
steps {
snInstallApp(credentialsId: "${CREDENTIALS}", url: "${PRODENV}", appSysId: "${APPSYSID}")
}
}
}
}