summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rwxr-xr-xicktool16
2 files changed, 15 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 498c60d..3ce825d 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,9 @@ Version 0.45+git, not yet released
* New command: `icktool show-latest-log PROJECT`.
+* `icktool make-it-so` now accepts filename from which to read project
+ and pipeline descriptions.
+
Version 0.45, released 2018-04-21
----------------------------------
diff --git a/icktool b/icktool
index 9230dd4..f384814 100755
--- a/icktool
+++ b/icktool
@@ -382,16 +382,24 @@ class BuildGraphCommand(Command):
class MakeItSoCommand(Command):
def execute(self, args):
- obj = self._read_object()
+ if not args:
+ obj = self._read_object(sys.stdin)
+ self._make_it_so(obj)
+ else:
+ for filename in args:
+ with open(filename) as f:
+ obj = self._read_object(f)
+ self._make_it_so(obj)
+ def _read_object(self, f):
+ return yaml.load(f)
+
+ def _make_it_so(self, obj):
self._create_resources(
'/projects', 'project', obj.get('projects', []))
self._create_resources(
'/pipelines', 'pipeline', obj.get('pipelines', []))
- def _read_object(self):
- return yaml.load(sys.stdin)
-
def _create_resources(self, path, name_field, objs):
for obj in objs:
try: