-
Notifications
You must be signed in to change notification settings - Fork 9
/
Jenkinsfile
55 lines (46 loc) · 1.85 KB
/
Jenkinsfile
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
49
50
51
52
53
54
55
@Library('va.gov-devops-jenkins-lib') _
import org.kohsuke.github.GitHub
env.CONCURRENCY = 10
node('vetsgov-general-purpose') {
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', daysToKeepStr: '60']],
parameters([choice(name: "cmsEnvBuildOverride",
description: "Choose an environment to run a content only build. Select 'none' to run the regular pipeline.",
choices: ["none", "vagovdev", "vagovstaging"].join("\n")),
booleanParam(name: "cancelBuild",
defaultValue: true,
description: "Hack to cancel the run triggered by webhook")])]);
stage('Cancel') {
if (params.cancelBuild) {
currentBuild.result = 'ABORTED'
error("Aborting run triggered by webhook. Please wait for the run triggered by the GitHub Actions workflow.");
}
}
// Checkout content-build code
dir("content-build") {
checkout scm
ref = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
}
def commonStages = load "content-build/jenkins/common.groovy"
// setupStage
dockerContainer = commonStages.setup()
stage('Review') {
if (commonStages.shouldBail()) {
currentBuild.result = 'ABORTED'
return
}
try {
if (!commonStages.isReviewable()) {
return
}
build job: 'deploys/vets-review-instance-deploy', parameters: [
stringParam(name: 'devops_branch', value: 'master'),
stringParam(name: 'api_branch', value: 'master'),
stringParam(name: 'web_branch', value: env.BRANCH_NAME),
stringParam(name: 'content_branch', value: env.BRANCH_NAME),
stringParam(name: 'source_repo', value: 'content-build'),
], wait: false
} catch (error) {
throw error
}
}
}