-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
65 lines (65 loc) · 1.63 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
pipeline {
agent any
triggers {
githubPush()
pollSCM('H H * * *')
}
parameters {
choice(name: 'test', choices: ['yes','no'], description: 'Run all tests ?')
choice(name: 'build_and_publish', choices: ['yes','no'], description: 'Build and publish assets ?')
}
environment {
MAIL_RECIPIENTS = '[email protected]'
}
options {
skipStagesAfterUnstable()
timestamps()
buildDiscarder(logRotator(numToKeepStr: '10'))
}
stages {
stage('Linters') {
when {
expression {
test == 'yes'
}
}
steps {
sh 'tox -e linters'
}
}
stage('Unit tests') {
when {
expression {
test == 'yes'
}
}
steps {
sh 'tox -e py39'
}
}
stage('Debian build and deploy') {
when {
expression {
build_and_publish == 'yes'
}
}
steps {
// This package is uploaded to public repo as a dependency to wazo-nestbox-plugin
build job: 'build-package', parameters: [
string(name: 'PACKAGE', value: "${env.JOB_NAME}"),
string(name: 'VERSION', value: sh(script: 'wazo-version unstable', returnStdout: true).trim()),
string(name: 'DEBIAN_REPOSITORY', value: 'engine'),
string(name: 'DEBIAN_DISTRIBUTION', value: 'wazo-dev-bullseye'),
]
}
}
}
post {
failure {
emailext to: "${MAIL_RECIPIENTS}", subject: '${DEFAULT_SUBJECT}', body: '${DEFAULT_CONTENT}'
}
fixed {
emailext to: "${MAIL_RECIPIENTS}", subject: '${DEFAULT_SUBJECT}', body: '${DEFAULT_CONTENT}'
}
}
}