Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adrien Plazas
deb-build-jobs
Commits
f6d250ee
Commit
f6d250ee
authored
Dec 21, 2018
by
Guido Gunther
Browse files
Send mails on package build failures
For now send them to myself only. Once this works we can switch to a list.
parent
60ea143d
Changes
1
Hide whitespace changes
Inline
Side-by-side
jobs.groovy
View file @
f6d250ee
...
...
@@ -36,6 +36,9 @@ def native_archs = [ primary_arch, 'amd64' ]
// Artifacts
def
artifacts
=
'*.deb'
// Who get's mail notifications
def
email_to
=
'guido.gunther@puri.sm'
// Load jobs from YAML file
Yaml
yaml
=
new
Yaml
()
def
jobsfile
=
(
new
File
(
__FILE__
)).
parent
+
'/jobs.yml'
...
...
@@ -98,35 +101,45 @@ pkgs.each { pkg ->
properties properties: [
disableConcurrentBuilds()
]
stage('Build Debian Package') {
node ('${build_node_label}') {
checkout([
userRemoteConfigs: [[url: '${params.url}']],
\$class: 'GitSCM',
branches: [[name: '${branch}']],
extensions: [[\$class: 'RelativeTargetDirectory',
relativeTargetDir: 'build'],
],
])
sh '''${build_cmd}'''
stash name: '${stash}', allowEmpty: false, includes: "${uploads.replaceAll(' ',',')}"
try {
stage('Build Debian Package') {
node ('${build_node_label}') {
checkout([
userRemoteConfigs: [[url: '${params.url}']],
\$class: 'GitSCM',
branches: [[name: '${branch}']],
extensions: [[\$class: 'RelativeTargetDirectory',
relativeTargetDir: 'build'],
],
])
sh '''${build_cmd}'''
stash name: '${stash}', allowEmpty: false, includes: "${uploads.replaceAll(' ',',')}"
}
}
}
stage('Upload Debian Packages') {
node ('${upload_node_label}') {
sh 'rm -f ${uploads}'
unstash '${stash}'
sh '''${upload_cmd}'''
stage('Upload Debian Packages') {
node ('${upload_node_label}') {
sh 'rm -f ${uploads}'
unstash '${stash}'
sh '''${upload_cmd}'''
}
}
}
stage('Save Artifacts') {
node ('${upload_node_label}') {
archiveArtifacts '${artifacts}'
stage('Save Artifacts') {
node ('${upload_node_label}') {
archiveArtifacts '${artifacts}'
}
}
} catch(err) {
currentBuild.result = 'FAILURE'
emailext body: '\${DEFAULT_CONTENT}',
replyTo: '\$DEFAULT_REPLYTO',
subject: '\${DEFAULT_SUBJECT}',
to: '${email_to}'
// Rethrow error
throw err
}
}
}
"""
.
stripIndent
())
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment