grim/local-pipelines

7359577fb08d
Parents e1884b499842
Children 3fcb5ebd0a1c
pipeline: convert script path to posix for windows

Docker for Windows needs a posix path to pass down to docker, so let's
manually convert to posix here.
--- a/pipelines/pipeline.py Sat Sep 10 18:55:22 2016 -0500
+++ b/pipelines/pipeline.py Sat Sep 10 19:34:59 2016 -0700
@@ -72,6 +72,14 @@
"com.atlassian.pipelines.agent=\"local\"",
]
+ # docker on windows needs to convert to a posix path
+ drive, spath = os.path.splitdrive(script)
+ if drive:
+ # strip off the colon, e.g. 'C:' -> 'C'
+ drive = drive[:-1]
+ # assemble the pieces together
+ script = '/' + drive + spath.replace('\\', '/')
+
volumes = [
"{filename}:{filename}:ro".format(filename=script),
"{path}:{workdir}:rw".format(