forked from zooniverse/zoo-stats-api-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
30 lines (25 loc) · 864 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
#!groovy
node {
checkout scm
def dockerRepoName = 'zooniverse/zoo-stats-api-graphql'
def dockerImageName = "${dockerRepoName}:${BRANCH_NAME}"
def newImage = null
stage('Build Docker image') {
newImage = docker.build(dockerImageName)
newImage.push()
}
if (BRANCH_NAME == 'master') {
stage('Update latest tag') {
newImage.push('latest')
}
stage('Deploy to Swarm') {
sh """
cd "/var/jenkins_home/jobs/Zooniverse GitHub/jobs/operations/branches/master/workspace" && \
./hermes_wrapper.sh exec StandaloneAppsSwarm -- \
docker stack deploy --prune \
-c /opt/infrastructure/stacks/zoo-event-stats-graphql.yml \
zoo-event-stats-graphql
"""
}
}
}