-
Notifications
You must be signed in to change notification settings - Fork 37
/
Jenkinsfile
66 lines (59 loc) · 1.19 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
pipeline {
agent {
node {
label 'test-slave'
}
}
options {
timeout(time: 1, unit: 'HOURS')
skipStagesAfterUnstable()
}
stages {
stage('Build') {
steps {
sh 'docker/build'
}
}
stage('Unit test') {
steps {
ansiColor('xterm') {
sh 'docker/unit-test'
}
}
}
stage('Integration test') {
steps {
ansiColor('xterm') {
sh 'integration-test/run-in-docker-compose'
}
}
}
stage('Publish') {
when {
branch 'master'
}
environment {
DOCKER_HUB = credentials('docker-hub');
}
steps {
sh 'DOCKER_HUB_USERNAME="$DOCKER_HUB_USR" DOCKER_HUB_PASSWORD="$DOCKER_HUB_PSW" docker/push'
}
}
stage('Deploy') {
when {
branch 'master'
}
steps {
withKubeConfig([credentialsId: 'overview-production-kubernetes', serverUrl: 'https://45EBEF84BD339E0D3D9716507CE1C450.yl4.us-east-1.eks.amazonaws.com']) {
sh 'kubernetes/deploy'
}
}
}
}
post {
always {
junit 'unit-test-results/**/*.xml'
junit 'integration-test/reports/**/*.xml'
}
}
}