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
task_id="$1"
artifact="$2"
shift 2
url="https://queue.taskcluster.net/v1/task/${task_id}/artifacts/${artifact}"
echo "Fetching $url"
curl \
--retry 5 \
--connect-timeout 10 \
--location
https://queue.taskcluster.net/v1/task/$1/artifacts/$2
--location \
"$url" \
"$@"

View file

@ -20,7 +20,7 @@ command_prefix = """
git checkout {event[after]} &&
""".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()
payload = {
"taskGroupId": os.environ["DECISION_TASK_ID"],
@ -45,6 +45,7 @@ def create_task(name, command, artifacts=None, dependencies=None):
"-c",
command_prefix + command
],
"env": env or {},
"artifacts": {
"public/" + artifact_name: {
"type": "file",
@ -68,4 +69,5 @@ create_task(
"run task",
"./run-task.sh",
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
gunzip executable.gz
chmod +x executable
./executable