forked from zooniverse/Panoptes-Front-End
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
41 lines (35 loc) · 834 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
35
36
37
38
39
40
41
#!groovy
node {
checkout scm
def dockerRepoName = 'zooniverse/panoptes-front-end'
def dockerImageName = "${dockerRepoName}:${BRANCH_NAME}"
def newImage = null
stage('Build Docker image') {
newImage = docker.build(dockerImageName)
if (BRANCH_NAME == 'master') {
stage('Update latest tag') {
newImage.push('latest')
}
}
}
// always stage branches (including master) to preview bucket path
stage('Deploy current branch') {
newImage.inside {
sh """
cd /src
npm run --silent stage-with-jenkins
"""
}
}
// deploy master branch changes to www.zooniverse.org
stage('Deploy production') {
if (BRANCH_NAME == 'master') {
newImage.inside {
sh """
cd /src
npm run --silent deploy
"""
}
}
}
}