Permalink
Browse files

Taskcluster: move curl’ing artifacts into decisionlib

  • Loading branch information...
SimonSapin committed Oct 11, 2018
1 parent d577a1c commit a6f389e933c952706fe7b52739f730c0ae7a732d
Showing with 26 additions and 35 deletions.
  1. +0 −23 etc/taskcluster/curl-artifact.sh
  2. +3 −12 etc/taskcluster/decision_task.py
  3. +23 −0 etc/taskcluster/decisionlib.py

This file was deleted.

Oops, something went wrong.
@@ -106,14 +106,9 @@ def android_x86():
return (
linux_task("Android x86: tests in emulator")
.with_dockerfile(dockerfile_path("run-android-emulator"))
.with_dependencies(build_task)
.with_env(BUILD_TASK_ID=build_task)
.with_repo()
.with_curl_artifact_script(build_task, "servoapp.apk", "target/i686-linux-android/release")
.with_script("""
mkdir -p target/i686-linux-android/release/
./etc/taskcluster/curl-artifact.sh ${BUILD_TASK_ID} servoapp.apk \
-o target/i686-linux-android/release/servoapp.apk
./mach bootstrap-android --accept-all-licences --emulator-x86
./mach test-android-startup --release
./mach test-wpt-android --release \
@@ -124,7 +119,6 @@ def android_x86():
)
def windows_dev():
return (
windows_build_task("Windows x64: dev build + unit tests")
@@ -220,11 +214,8 @@ def linux_run_task(name, build_task, script):
linux_task(name)
.with_dockerfile(dockerfile_path("run"))
.with_repo()
.with_early_script("""
./etc/taskcluster/curl-artifact.sh ${BUILD_TASK_ID} target.tar.gz | tar -xz
""")
.with_env(BUILD_TASK_ID=build_task)
.with_dependencies(build_task)
.with_curl_artifact_script(build_task, "target.tar.gz")
.with_script("tar -xzf target.tar.gz")
.with_script(script)
.with_index_and_artifacts_expire_in(log_artifacts_expire_in)
.with_artifacts(*[
@@ -513,6 +513,7 @@ def __init__(self, *args, **kwargs):
self.caches = {}
self.features = {}
self.artifacts = []
self.curl_scripts_count = 0
with_docker_image = chaining(setattr, "docker_image")
with_max_run_time_minutes = chaining(setattr, "max_run_time_minutes")
@@ -560,6 +561,28 @@ def with_features(self, *names):
self.features.update({name: True for name in names})
return self
def with_curl_script(self, url, file_path):
self.curl_scripts_count += 1
n = self.curl_scripts_count
return self \
.with_env(**{
"CURL_%s_URL" % n: url,
"CURL_%s_PATH" % n: file_path,
}) \
.with_script("""
mkdir -p $(dirname "$CURL_{n}_PATH")
curl --retry 5 --connect-timeout 10 --Lf "$CURL_{n}_URL" -o "$CURL_{n}_PATH"
""".format(n=n))
def with_curl_artifact_script(self, task_id, artifact_name, out_directory=""):
return self \
.with_dependencies(task_id) \
.with_curl_script(
"https://queue.taskcluster.net/v1/task/%s/artifacts/public/%s"
% (task_id, artifact_name),
os.path.join(out_directory, url_basename(artifact_name)),
)
def with_repo(self):
"""
Make a shallow clone the git repository at the start of the task.

0 comments on commit a6f389e

Please sign in to comment.