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
6f590c71
Commit
6f590c71
authored
Mar 29, 2015
by
intrigeri
Browse files
Don't manipulate __dict__ directly: instead {load into,dump from} the job attribute.
parent
068f3d04
Changes
1
Hide whitespace changes
Inline
Side-by-side
files/jenkins/master/generate_build_tails_iso_jobs.py
View file @
6f590c71
...
...
@@ -18,8 +18,7 @@ class BuildTailsISOJob:
assert
type
(
branch
[
'base_branch'
])
is
bool
assert
type
(
snippet
)
is
str
assert
snippet
.
__len__
()
>
0
base
=
yaml
.
safe_load
(
snippet
)
self
.
__dict__
.
update
(
**
base
[
0
])
self
.
job
=
yaml
.
safe_load
(
snippet
)
self
.
job
[
'name'
]
=
"build_Tails_ISO_"
+
branch
[
'job_name'
]
self
.
job
[
'scm'
]
=
[{
'git'
:
\
{
'branches'
:
[
branch
[
'branch_name'
]],
...
...
@@ -31,7 +30,7 @@ class BuildTailsISOJob:
self
.
job
[
'publishers'
]
=
[{
'email'
:
{
'recipients'
:
self
.
TAILS_RM_EMAIL
}}]
def
__str__
(
self
):
return
yaml
.
safe_dump
([
self
.
__dict__
],
default_flow_style
=
False
)
return
yaml
.
safe_dump
([
{
'job'
:
self
.
job
}
],
default_flow_style
=
False
)
def
get_active_branches
():
...
...
@@ -48,20 +47,19 @@ def get_active_branches():
]
JOB_SNIPPET
=
'''- job:
node: isobuilder1 || isobuilder2
builders:
- build_Tails_ISO
- clean_Archives
triggers:
- pollscm: '@weekly'
- timed: '@daily'
wrappers:
- timestamps
- workspace-cleanup:
dirmatch: true
include:
- "**"'''
JOB_SNIPPET
=
'''node: isobuilder1 || isobuilder2
builders:
- build_Tails_ISO
- clean_Archives
triggers:
- pollscm: '@weekly'
- timed: '@daily'
wrappers:
- timestamps
- workspace-cleanup:
dirmatch: true
include:
- "**"'''
if
__name__
==
"__main__"
:
for
branch
in
get_active_branches
():
...
...
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