forked from department-of-veterans-affairs/vets-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.content
49 lines (38 loc) · 1.43 KB
/
Jenkinsfile.content
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
@Library('va.gov-devops-jenkins-lib') _
node('vetsgov-general-purpose') {
refStatusState = ""
ref = params.ref
if (ref == "") {
ref = getLatestGitRef("vets-website", branch: "master")
}
refStatusState = getGithubCommitState("vets-website", ref)
if ("${refStatusState}" != "SUCCESS") {
slackSend(message:"Web content refresh on ${params.env} aborted due to '${refStatusState}' status on vets-website commit ${ref}.",
color: "warning",
channel: "cms-notifications")
return
}
dir("vets-website") {
checkout scm: [$class: 'GitSCM', branches: [[name: ref]], userRemoteConfigs: [[credentialsId: 'va-bot', url: 'git@github.com:department-of-veterans-affairs/vets-website.git']]]
}
def commonStages = load "vets-website/jenkins/common.groovy"
// Setup stage
dockerContainer = commonStages.setup()
stage("Build") {
commonStages.build(ref, dockerContainer, ref, params.env, false)
}
stage("Prearchive") {
commonStages.prearchive(dockerContainer, params.env)
}
stage("Archive") {
commonStages.archive(dockerContainer, ref, params.env)
}
stage("Deploy Dev or Staging") {
if (params.env != "vagovprod" && params.deploy) {
commonStages.runDeploy("deploys/vets-website-${params.env}", ref, true)
slackSend(message:"Web content refresh in ${params.env} completed.",
color: "good",
channel: "cms-notifications")
}
}
}