-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
76 lines (69 loc) · 2.07 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
pipeline {
agent { label "master" }
environment {
AWS_REGION = "us-east-1"
KOPS_STATE_STORE = "S3://k8s-reconfigure-infra"
RECO_INTERCOM_ACCESS_TOKEN = credentials('intercom_token')
}
options {
buildDiscarder(logRotator(daysToKeepStr: '', numToKeepStr: '20'))
disableConcurrentBuilds()
}
post {
failure {
slackSend (color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
success {
slackSend (color: '#00FF00', message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
}
stages {
stage("notify") {
steps {
slackSend (color: '#FFFF00', message: "STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
}
stage('checkout') {
steps {
checkout scm
}
}
stage('pre-clean') {
steps {
sh 'docker-compose run --rm web-base make clean'
sh 'docker-compose down'
sh 'docker network prune --force'
}
}
stage('install') {
steps {
sh 'docker-compose run --rm web-base make install'
}
}
stage('test') {
steps {
sh 'docker-compose run --rm test make vet integration-tests'
}
}
stage('clean') {
steps {
sh 'docker-compose run --rm web-base make clean'
sh 'docker-compose down'
}
}
stage('build') {
steps {
sh 'docker-compose run --rm web-base make all'
sh 'make image'
}
}
stage ('deploy') {
when {
expression { env.BRANCH_NAME in ["master"] }
}
steps {
sh 'make push-image migrate-staging deploy-staging migrate-production deploy-production'
}
}
}
}