Fix run task

This commit is contained in:
Simon Sapin 2018-08-30 17:36:37 +02:00
parent cc488fe538
commit 97e843c4c5
3 changed files with 12 additions and 3 deletions

View file

@ -1,6 +1,12 @@
#!/bin/sh #!/bin/sh
task_id="$1"
artifact="$2"
shift 2
url="https://queue.taskcluster.net/v1/task/${task_id}/artifacts/${artifact}"
echo "Fetching $url"
curl \ curl \
--retry 5 \ --retry 5 \
--connect-timeout 10 \ --connect-timeout 10 \
--location --location \
https://queue.taskcluster.net/v1/task/$1/artifacts/$2 "$url" \
"$@"

View file

@ -20,7 +20,7 @@ command_prefix = """
git checkout {event[after]} && git checkout {event[after]} &&
""".format(event=event) """.format(event=event)
def create_task(name, command, artifacts=None, dependencies=None): def create_task(name, command, artifacts=None, dependencies=None, env=None):
task_id = taskcluster.slugId() task_id = taskcluster.slugId()
payload = { payload = {
"taskGroupId": os.environ["DECISION_TASK_ID"], "taskGroupId": os.environ["DECISION_TASK_ID"],
@ -45,6 +45,7 @@ def create_task(name, command, artifacts=None, dependencies=None):
"-c", "-c",
command_prefix + command command_prefix + command
], ],
"env": env or {},
"artifacts": { "artifacts": {
"public/" + artifact_name: { "public/" + artifact_name: {
"type": "file", "type": "file",
@ -68,4 +69,5 @@ create_task(
"run task", "run task",
"./run-task.sh", "./run-task.sh",
dependencies=[build_task], dependencies=[build_task],
env={"BUILD_TASK_ID": build_task},
) )

View file

@ -2,4 +2,5 @@
./curl-artifact.sh $BUILD_TASK_ID public/executable.gz -o executable.gz ./curl-artifact.sh $BUILD_TASK_ID public/executable.gz -o executable.gz
gunzip executable.gz gunzip executable.gz
chmod +x executable
./executable ./executable