Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emmapeel
puppet-tails
Commits
f42be722
Commit
f42be722
authored
Mar 29, 2015
by
intrigeri
Browse files
Handle the two (only?) cases wrt. email notification upon Jenkins build failure.
parent
57249549
Changes
1
Hide whitespace changes
Inline
Side-by-side
files/jenkins/master/generate_build_tails_iso_jobs
View file @
f42be722
...
...
@@ -24,6 +24,11 @@ wrappers:
include:
- "**"'''
VALID_JOB_RECIPIENTS
=
[
'release_managers'
,
'whoever_broke_the_build'
,
]
def
__init__
(
self
,
branch
,
snippet
=
JOB_SNIPPET
):
assert
type
(
branch
[
'branch_name'
])
is
str
assert
branch
[
'branch_name'
].
__len__
()
>
0
...
...
@@ -32,6 +37,8 @@ wrappers:
assert
type
(
branch
[
'base_branch'
])
is
bool
assert
type
(
snippet
)
is
str
assert
snippet
.
__len__
()
>
0
assert
type
(
branch
[
'job_recipients'
])
is
str
assert
self
.
VALID_JOB_RECIPIENTS
.
count
(
branch
[
'job_recipients'
])
self
.
job
=
yaml
.
safe_load
(
snippet
)
self
.
job
[
'name'
]
=
branch
[
'job_name'
]
self
.
job
[
'scm'
]
=
[{
'git'
:
\
...
...
@@ -40,8 +47,16 @@ wrappers:
'browser-url'
:
'https://git-tails.immerda.ch/tails/'
,
'url'
:
'gitolite@puppet-git.lizard:tails'
}
}]
if
branch
[
'base_branch'
]:
self
.
job
[
'publishers'
]
=
[{
'email'
:
{
'recipients'
:
TAILS_RM_EMAIL
}}]
if
branch
[
'job_recipients'
]
==
'release_managers'
:
self
.
job
[
'publishers'
]
=
[
{
'email'
:
{
'recipients'
:
TAILS_RM_EMAIL
}}
]
elif
branch
[
'job_recipients'
]
==
'whoever_broke_the_build'
:
self
.
job
[
'publishers'
]
=
[
{
'email'
:
{
'sent-to-individuals'
:
True
}}
]
else
:
raise
""
self
.
job
[
'description'
]
=
self
.
DESCRIPTION_TEMPLATE
%
{
'job_name'
:
self
.
job
[
'name'
]
}
...
...
@@ -55,10 +70,12 @@ def get_active_branches():
Now is just a stub returning a list of branch dict."""
return
[{
'branch_name'
:
'feature/test_active_branch_job'
,
'job_name'
:
'build_Tails_ISO_feature-test_active_branch_job'
,
'job_recipients'
:
'whoever_broke_the_build'
,
'base_branch'
:
False
,
},
{
'branch_name'
:
'bugfix/there_should_be_two_of_them'
,
'job_name'
:
'build_Tails_ISO_bugfix-there_should_be_two_of_them'
,
'job_recipients'
:
'release_managers'
,
'base_branch'
:
True
,
},
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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