--- a/pipelines/core.py Wed Jul 27 10:05:15 2016 -0500
+++ b/pipelines/core.py Thu Jul 28 13:55:01 2016 -0500
@@ -84,10 +84,6 @@
- # the variable was passed as "-e FOO" so we should grab "FOO" from the
- v = os.environ.get(k, "")
--- a/pipelines/pipeline.py Wed Jul 27 10:05:15 2016 -0500
+++ b/pipelines/pipeline.py Thu Jul 28 13:55:01 2016 -0500
@@ -30,19 +30,31 @@
self.build_path = os.path.abspath(path)
- self.steps = self._get_steps()
+ ret = self.config["pipelines"]["default"] if "branches" in self.config["pipelines"]:
branches = self.config["pipelines"]["branches"]
for pattern, steps in branches.iteritems():
if fnmatch.fnmatch(self.branch, pattern):
+ return [Step.from_dict(s["step"]) for s in ret] - return self.config["pipelines"]["default"]
+ # dict of env vars that are not none + return {k: v for k, v in self._env.iteritems() if v is not None} + # dict of env vars that are none (grabbed from os.environ) + return {k: os.environ.get(k, "") for k, v in self._env.iteritems() def _determine_image(self, step):
return step.image or self.config.get("image")
@@ -72,26 +84,28 @@
" ".join(["-v " + v for v in volumes]),
" ".join(["--label " + l for l in labels]),
- " ".join(["-e " + k + "=" + v for k, v in self.env.iteritems()]),
+ " ".join(["-e {}={}".format(k, v) for k, v in + self.public_env.iteritems()]), + " ".join(["-e " + k for k in self.private_env.keys()]), self._determine_image(step),
- return [Step.from_dict(s["step"]) for s in self.steps]
+ subenv = os.environ.copy() + subenv.update(self.private_env) - for n, step in enumerate(self._steps()):
+ for n, step in enumerate(self.steps): script = step.script_file()
command = self._get_command(step, script)
print('+ {}'.format(command))
- proc = subprocess.Popen(command.split())
+ proc = subprocess.Popen(command.split(), return_code = proc.wait()