Revision control

1
pipeline {
2
agent any
3
triggers {
4
cron(env.BRANCH_NAME == 'master' ? 'H 0 * * *' : '')
5
}
6
options {
7
timestamps()
8
timeout(time: 1, unit: 'HOURS')
9
}
10
stages {
11
stage('checkout') {
12
when { branch 'master' }
13
steps {
14
checkout scm
15
}
16
}
17
stage('bootstrap') {
18
when { branch 'master' }
19
steps {
20
sh './bootstrap.sh'
21
}
22
}
23
stage('test') {
24
when { branch 'master' }
25
steps {
26
dir('SyncIntegrationTests') {
27
sh 'pipenv install'
28
sh 'pipenv check'
29
sh 'pipenv run pytest ' +
30
'--color=yes ' +
31
'--junit-xml=results/junit.xml ' +
32
'--html=results/index.html'
33
}
34
}
35
}
36
}
37
post {
38
always {
39
script {
40
if (env.BRANCH_NAME == 'master') {
41
archiveArtifacts 'SyncIntegrationTests/results/*'
42
junit 'SyncIntegrationTests/results/*.xml'
43
publishHTML(target: [
44
allowMissing: false,
45
alwaysLinkToLastBuild: true,
46
keepAll: true,
47
reportDir: 'SyncIntegrationTests/results',
48
reportFiles: 'index.html',
49
reportName: 'HTML Report'])
50
}
51
}
52
}
53
54
failure {
55
script {
56
if (env.BRANCH_NAME == 'master') {
57
slackSend(
58
color: 'danger',
59
message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
60
}
61
}
62
}
63
fixed {
64
slackSend(
65
color: 'good',
66
message: "FIXED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
67
}
68
}
69
}