-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathinstall-app-customization
More file actions
42 lines (41 loc) · 1.58 KB
/
install-app-customization
File metadata and controls
42 lines (41 loc) · 1.58 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
// Example of full CI/CD for customized application on NOW platform
pipeline {
agent any
// parameters {
// ServiceNow Parameters should be created by selecting the option 'This build is parameterized' in job configuration.
// Otherwise it won't be possible to pass variables between publish -> install steps.
// snParam(...)
// }
environment {
BRANCH = "${BRANCH_NAME}"
APPSYSID = '00f35c601b2b9410fe0165f8bc4bcb06'
CREDENTIALS = '7b4ca59e-8486-486c-895e-f044a5297447'
DEVENV = 'https://devinstance.service-now.com/'
TESTENV = 'https://testinstance.service-now.com/'
PRODENV = 'https://prodinstance.service-now.com/'
TESTSUITEID = 'b1ae55eedb541410874fccd8139619fb'
}
stages {
stage('Build') {
steps {
snApplyChanges(appSysId: "${APPSYSID}", branchName: "${BRANCH}", url: "${DEVENV}", credentialsId: "${CREDENTIALS}")
snPublishApp(credentialsId: "${CREDENTIALS}", url: "${DEVENV}", appSysId: "${APPSYSID}",
isAppCustomization: true, obtainVersionAutomatically: true, incrementBy: 2)
}
}
stage('Install') {
steps {
snInstallApp(credentialsId: "${CREDENTIALS}", url: "${TESTENV}", appSysId: "${APPSYSID}", baseAppAutoUpgrade: false)
snRunTestSuite(credentialsId: "${CREDENTIALS}", url: "${TESTENV}", testSuiteSysId: "${TESTSUITEID}", withResults: true)
}
}
stage('Deploy to Prod') {
when {
branch 'master'
}
steps {
snInstallApp(credentialsId: "${CREDENTIALS}", url: "${PRODENV}", appSysId: "${APPSYSID}", baseAppAutoUpgrade: false)
}
}
}
}