forked from mdn/interactive-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
34 lines (31 loc) · 821 Bytes
/
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
#!groovy
def buildSite() {
stage ('build') {
try {
sh 'bin/build.sh'
} catch(err) {
sh "bin/irc-notify.sh --stage 'build " + env.BRANCH_NAME + "' --status 'failed'"
throw err
}
}
}
def syncS3(String bucket, String extra_args='') {
stage ('s3 sync') {
try {
sh "bin/s3-sync.sh ${bucket} ${extra_args}"
} catch(err) {
sh "bin/irc-notify.sh --stage 's3 sync " + env.BRANCH_NAME + "' --status 'failed'"
throw err
}
sh "bin/irc-notify.sh --stage 's3 sync " + env.BRANCH_NAME + "' --status 'shipped'"
}
}
node {
stage ('Prepare') {
checkout scm
}
if ( env.BRANCH_NAME == 'prod' ) {
buildSite()
syncS3('mdninteractive-b77d14bceaaa9ea4')
}
}