--- a/pipelines/core.py Sat Sep 10 22:09:37 2016 -0500
+++ b/pipelines/core.py Mon Sep 19 13:26:47 2016 -0500
@@ -65,6 +65,16 @@
+ help="Run a shell instead of the script in the container. The " + + "script can be run via /tmp/bitbucket-pipelines.sh. This " + + "will get weird if you're running more than one step.", return parser.parse_args()
@@ -127,6 +137,6 @@
k, v = _split_env_var(var)
- pipeline = Pipeline(config, path, repo, env)
+ pipeline = Pipeline(config, path, repo, args.run_shell, env) --- a/pipelines/pipeline.py Sat Sep 10 22:09:37 2016 -0500
+++ b/pipelines/pipeline.py Mon Sep 19 13:26:47 2016 -0500
@@ -26,12 +26,15 @@
- def __init__(self, config, path, repo, env=None):
+ def __init__(self, config, path, repo, run_shell=False, env=None): self.build_path = os.path.abspath(path)
+ self.run_shell = run_shell + print('{}({})'.format(self.run_shell, type(self.run_shell))) self._env["BITBUCKET_BRANCH"] = self.repo.branch
self._env["BITBUCKET_COMMIT"] = self.repo.node
@@ -80,14 +83,23 @@
# assemble the pieces together
script = '/' + drive + spath.replace('\\', '/')
+ script_internal = "/tmp/bitbucket-pipelines.sh" - "{filename}:{filename}:ro".format(filename=script),
+ "{filename}:{script_internal}:ro".format( + script_internal=script_internal, "{path}:{workdir}:rw".format(
+ command = script_internal @@ -102,7 +114,7 @@
self.public_env.items()]),
" ".join(["-e " + k for k in self.private_env.keys()]),
self._determine_image(step),