-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
61 lines (61 loc) · 1.59 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
pipeline {
agent any
triggers {
githubPush()
pollSCM('H H * * *')
}
environment {
MAIL_RECIPIENTS = 'dev+tests-reports@wazo.community'
}
options {
skipStagesAfterUnstable()
timestamps()
buildDiscarder(logRotator(numToKeepStr: '10'))
throttleJobProperty(
categories: ['asterisk'],
throttleEnabled: true,
throttleOption: 'category'
)
}
stages {
stage ('Prepare') {
steps {
script {
version = sh(script: 'dpkg-parsechangelog --show-field version', returnStdout: true).trim()
currentBuild.displayName = "${JOB_NAME} ${version}"
currentBuild.description = "Build Debian package ${JOB_NAME} ${version}"
}
}
}
stage('Debian build and deploy') {
steps {
build job: 'build-package-multi-arch', parameters: [
string(name: 'PACKAGE', value: "${JOB_NAME}"),
string(name: 'VERSION', value: "${version}"),
]
}
}
stage('Docker build') {
steps {
sh "docker build --no-cache -t wazoplatform/${JOB_NAME}:latest ."
}
}
stage('Docker publish') {
steps {
sh "docker push wazoplatform/${JOB_NAME}:latest"
}
}
}
post {
success {
build wait: false, job: 'asterisk-to-asterisk-vanilla'
build wait: false, job: 'asterisk-to-asterisk-debug'
}
failure {
emailext to: "${MAIL_RECIPIENTS}", subject: '${DEFAULT_SUBJECT}', body: '${DEFAULT_CONTENT}'
}
fixed {
emailext to: "${MAIL_RECIPIENTS}", subject: '${DEFAULT_SUBJECT}', body: '${DEFAULT_CONTENT}'
}
}
}