--- a/bitbucket-pipelines.yml Tue Jul 26 19:58:49 2016 -0500
+++ b/bitbucket-pipelines.yml Tue Jul 26 21:26:55 2016 -0500
@@ -4,5 +4,8 @@
+ - find . -type f -iname "*.pyc" -exec rm -f {} \; || true + - find . -type d -iname __pycache__ -exec rm -rf {} \; || true - pip install -r dev-requirements.txt
+ - PYTHONPATH=$(pwd) py.test --color=auto --cov=pipelines --cov-report=term-missing tests --- a/dev-requirements.txt Tue Jul 26 19:58:49 2016 -0500
+++ b/dev-requirements.txt Tue Jul 26 21:26:55 2016 -0500
@@ -1,3 +1,5 @@
--- a/pipelines/pipeline.py Tue Jul 26 19:58:49 2016 -0500
+++ b/pipelines/pipeline.py Tue Jul 26 21:26:55 2016 -0500
@@ -21,7 +21,8 @@
+from pipelines.step import Step @@ -44,21 +45,7 @@
return self.config["pipelines"]["default"]
def _determine_image(self, step):
- return step.get("image", self.config.get("image"))
- def _script(self, step):
- fd, filename = tempfile.mkstemp(prefix='pipeline', suffix='.sh')
- filename = os.path.realpath(filename)
- with os.fdopen(fd, "w") as ofp:
- ofp.write("#!/bin/bash\n")
- content = " && \\\n".join(step["script"])
+ return step.image or self.config.get("image") def _get_command(self, step, script):
workdir = "/opt/atlassian/bitbucketci/agent/build"
@@ -93,13 +80,13 @@
- return [s["step"] for s in self.steps]
+ return [Step.from_dict(s["step"]) for s in self.steps] for n, step in enumerate(self._steps()):
- script = self._script(step)
+ script = step.script_file() command = self._get_command(step, script)