diff --git a/decision-task.py b/decision-task.py index d41de9e9e5e..fa8b9daf8b6 100644 --- a/decision-task.py +++ b/decision-task.py @@ -1,8 +1,9 @@ # coding: utf8 -import os -import sys import json +import os +import re +import sys import taskcluster @@ -111,14 +112,17 @@ def create_task(name, command, image, artifacts=None, dependencies=None, env=Non "command": [ "/bin/bash", "--login", + "-x", + "-e", "-c", - """ - set -e - set -x - git clone $GITHUB_EVENT_CLONE_URL repo - cd repo - git checkout $GITHUB_EVENT_COMMIT_SHA - """ + command + deindent( + """ + git clone $GITHUB_EVENT_CLONE_URL repo + cd repo + git checkout $GITHUB_EVENT_COMMIT_SHA + """ + + command + ) ], "env": env, "artifacts": { @@ -137,5 +141,9 @@ def create_task(name, command, image, artifacts=None, dependencies=None, env=Non return task_id +def deindent(string): + return re.sub("\n +", "\n ", string) + + if __name__ == "__main__": main()