- job: | |
name: lkft-notify-developer | |
project-type: freestyle | |
defaults: global | |
properties: | |
- authorization: | |
anonymous: | |
- job-read | |
- job-extended-read | |
everyone-flat: | |
- job-build | |
- job-cancel | |
- build-discarder: | |
days-to-keep: 30 | |
num-to-keep: 30 | |
parameters: | |
- string: | |
name: BUILD_URL | |
description: 'Developer build API URL; i.e. https://qa-reports.linaro.org/api/builds/9367/' | |
- string: | |
name: EMAIL_DESTINATION | |
description: 'Email address to notify, instead of default behavior' | |
- bool: | |
name: DRY_RUN | |
description: 'Do not notify; just run and echo the report to the console' | |
default: False | |
disabled: false | |
node: master | |
concurrent: false | |
display-name: 'LKFT Notify Developer' | |
scm: | |
- git: | |
url: https://github.com/Linaro/lkft-tools.git | |
refspec: +refs/heads/*:refs/remotes/origin/* | |
name: origin | |
branches: | |
- refs/heads/master | |
skip-tag: true | |
shallow-clone: true | |
wipe-workspace: false | |
clean: | |
before: true | |
wrappers: | |
- timeout: | |
timeout: 60 | |
- timestamps | |
builders: | |
- shell: | | |
#!/bin/bash | |
set -ex | |
python ./bin/lkft_notify_developer.py ${BUILD_URL} | |
if [ -n "${EMAIL_DESTINATION}" ]; then | |
# Override email.to if EMAIL_DESTINATION is set. | |
echo ${EMAIL_DESTINATION} > email.to | |
fi | |
# Append default email addresses | |
echo -n ",dan.rue@linaro.org,daniel.diaz@linaro.org" >> email.to | |
publishers: | |
- email-ext: | |
# Send custom email generated in jenkins job | |
recipients: ${FILE,path="email.to"} | |
subject: ${FILE,path="email.subject"} | |
content-type: text | |
body: | | |
${FILE,path="email.body"} | |
presend-script: "if (${DRY_RUN} == true){logger.println(\"DRY_RUN is set; skipping email notification\"); cancel = true}" | |
success: true | |
failure: false | |
- email: | |
recipients: 'dan.rue@linaro.org daniel.diaz@linaro.org' |