Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/buildbot/manifests/fragment.pp

Issue 29325436: Issue 1281 - Introduce module buildbot (Closed)
Patch Set: Issue 1281 - Rebase branch buildbot on top of upstream Created Sept. 5, 2015, 11:27 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: modules/buildbot/manifests/fragment.pp
diff --git a/modules/buildbot/manifests/fragment.pp b/modules/buildbot/manifests/fragment.pp
new file mode 100644
index 0000000000000000000000000000000000000000..afad97a418f1298dfb63e729df9b979f519a2822
--- /dev/null
+++ b/modules/buildbot/manifests/fragment.pp
@@ -0,0 +1,50 @@
+# == Type: buildbot::fragment
+#
+# Manage Buildbot (https://buildbot.net/) master configuration fragments.
+#
+# === Parameters:
+#
+# [*authority*]
+# The master instance to append the configuration fragment to.
+#
+# [*content*]
+# The configuration fragment's content. Mutually exclusive with $source.
+#
+# [*order*]
+# An indicator for concat::fragment ordering.
+#
+# [*source*]
+# The configuration fragment's content. Defaults to $title. Mutually
+# exclusive with $content.
+#
+# === Examples:
+#
+# buildbot::fragment {
+# authority => Buildbot::Master['example'],
+# content => "# additional python code for master.cfg",
+# }
+#
+define buildbot::fragment(
+ $authority,
+ $content = '',
+ $order = 50,
+ $source = '',
+) {
+
+ $master = getparam($authority, 'title')
+ $basedir = getparam($authority, 'basedir')
+ $config = "$basedir/master.cfg"
+
+ realize(Concat[$config])
+ realize(Concat::Fragment[$config])
+
+ concat::fragment {"buildbot::fragment#$title":
+ content => $content,
+ order => $order,
+ source => "$content$source" ? {
+ '' => $title,
+ default => $source,
+ },
+ target => $config,
+ }
+}

Powered by Google App Engine
This is Rietveld