This repository was archived by the owner on Aug 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
54 lines (48 loc) · 1.68 KB
/
Jenkinsfile
File metadata and controls
54 lines (48 loc) · 1.68 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
45
46
47
48
49
50
51
52
53
54
#!groovy
node {
try {
// Checkout the proper revision into the workspace.
stage('checkout') {
checkout scm
}
env.AWS_DEFAULT_REGION = 'us-east-1'
env.RF_DOCS_BUCKET = 'rasterfoundry-staging-docs-site-us-east-1'
// Use the production docs bucket for releases.
if (env.BRANCH_NAME.startsWith('release/')) {
env.RF_DOCS_BUCKET = 'rasterfoundry-production-docs-site-us-east-1'
}
// Execute `cibuild` wrapped within a plugin that translates
// ANSI color codes to something that renders inside the Jenkins
// console.
stage('cibuild') {
wrap([$class: 'AnsiColorBuildWrapper']) {
sh 'scripts/cibuild'
}
}
if (env.BRANCH_NAME == 'develop' || env.BRANCH_NAME.startsWith('release/')) {
// Publish asset bundle built and tested during `cibuild`
// to the website S3 bucket.
stage('cipublish') {
wrap([$class: 'AnsiColorBuildWrapper']) {
sh './scripts/cipublish'
}
}
}
} catch (err) {
// Some exception was raised in the `try` block above. Assemble
// an appropirate error message for Slack.
def slackMessage = ":jenkins-angry: *raster-foundry-docs (${env.BRANCH_NAME}) #${env.BUILD_NUMBER}*"
if (env.CHANGE_TITLE) {
slackMessage += "\n${env.CHANGE_TITLE} - ${env.CHANGE_AUTHOR}"
}
slackMessage += "\n<${env.BUILD_URL}|View Build>"
slackSend color: 'danger', message: slackMessage
// Re-raise the exception so that the failure is propagated to
// Jenkins.
throw err
} finally {
// Pass or fail, ensure that the services and networks
// created by Docker Compose are torn down.
sh 'docker-compose down -v'
}
}