grim/local-pipelines

b402a0acb748
Parents 16aaa2b6454a
Children cf2d13c055f4
pipeline: change branch parameter into repo class
--- a/pipelines/core.py Wed Jul 27 22:18:24 2016 -0700
+++ b/pipelines/core.py Wed Jul 27 22:18:59 2016 -0700
@@ -118,7 +118,6 @@
path, config = _load_config(args.pipeline_filename)
- branch = vcs.get_branch(path)
repo = vcs.repo(path)
env = _load_env(args.env_filenames)
@@ -128,6 +127,6 @@
k, v = _split_env_var(var)
env[k] = v
- pipeline = Pipeline(config, path, branch, env)
+ pipeline = Pipeline(config, path, repo, env)
sys.exit(pipeline.run())
--- a/pipelines/pipeline.py Wed Jul 27 22:18:24 2016 -0700
+++ b/pipelines/pipeline.py Wed Jul 27 22:18:59 2016 -0700
@@ -26,10 +26,10 @@
class Pipeline(object):
- def __init__(self, config, path, branch, env=None):
+ def __init__(self, config, path, repo, env=None):
self.config = config
self.build_path = os.path.abspath(path)
- self.branch = branch
+ self.repo = repo
self._env = env or {}
@property
@@ -39,7 +39,7 @@
branches = self.config["pipelines"]["branches"]
for pattern, steps in branches.iteritems():
- if fnmatch.fnmatch(self.branch, pattern):
+ if fnmatch.fnmatch(self.repo.branch, pattern):
ret = steps
break