diff --git a/automation/taskcluster/androidTest/ui-test.sh b/automation/taskcluster/androidTest/ui-test.sh index 62e5c702f..6cdf49fb1 100755 --- a/automation/taskcluster/androidTest/ui-test.sh +++ b/automation/taskcluster/androidTest/ui-test.sh @@ -34,7 +34,6 @@ display_help() { } get_abs_filename() { - # $1 : relative filename relative_filename="$1" echo "$(cd "$(dirname "$relative_filename")" && pwd)/$(basename "$relative_filename")" } diff --git a/automation/taskcluster/upload_apk_nimbledroid.py b/automation/taskcluster/upload_apk_nimbledroid.py index 29f41d8d5..374f92436 100644 --- a/automation/taskcluster/upload_apk_nimbledroid.py +++ b/automation/taskcluster/upload_apk_nimbledroid.py @@ -7,7 +7,6 @@ This script talks to the taskcluster secrets service to obtain the Nimbledroid account key and upload Klar and Focus apk to Nimbledroid for perf analysis. """ -import taskcluster import requests import json import urllib2 @@ -33,18 +32,11 @@ def uploadApk(apk,key): print json.dumps(response.json(), indent=4) -def uploadNightlyFenixApk(apk_url, key): - apk_data = urllib2.urlopen(apk_url).read() - with open('./fenix_example_nd.apk', 'wb') as f: - f.write(apk_data) - uploadApk({'apk' : open('fenix_example_nd.apk')},key) +apk_path = sys.argv[1] +token_file = sys.argv[2] +with open(token_file) as f: + key = f.read() -# Get JSON data from taskcluster secrets service -secrets = taskcluster.Secrets({ - 'rootUrl': os.environ.get('TASKCLUSTER_PROXY_URL', 'https://taskcluster.net'), -}) -data = secrets.get('project/mobile/fenix/nimbledroid') -# upload the nightly build to Nimbledroid -apk_url = sys.argv[1] -uploadNightlyFenixApk(apk_url, data['secret']['api_key']) +with open(apk_path) as apk_file: + uploadApk({'apk': apk_file}, key) diff --git a/taskcluster/ci/nimbledroid/kind.yml b/taskcluster/ci/nimbledroid/kind.yml index 0d6694999..9300ccffd 100644 --- a/taskcluster/ci/nimbledroid/kind.yml +++ b/taskcluster/ci/nimbledroid/kind.yml @@ -9,34 +9,33 @@ transforms: - taskgraph.transforms.task:transforms kind-dependencies: - - build + - signing -job-defaults: - description: Upload APKs to Nimbledroid for performance measurement and tracking - worker-type: b-android - worker: - docker-image: {in-tree: nimbledroid} - max-run-time: 600 - run-on-tasks-for: [] - treeherder: - kind: test - tier: 2 - platform: android-all/opt - scopes: - - secrets:get:project/mobile/fenix/nimbledroid - run: - using: run-task - use-caches: false - command: - - python - - /builds/worker/checkouts/src/automation/taskcluster/upload_apk_nimbledroid.py - - {artifact-reference: ""} jobs: nightly: attributes: nightly: true - treeherder: - symbol: nimbledroid dependencies: - build: build-nightly + signing: signing-nightly + description: Upload APKs to Nimbledroid for performance measurement and tracking + run: + commands: + - [wget, {artifact-reference: ''}, '-O', target.apk] + - [python, automation/taskcluster/upload_apk_nimbledroid.py, target.apk, .nimbledroid_token] + secrets: + - name: project/mobile/fenix/nimbledroid + key: api_key + path: .nimbledroid_token + using: run-commands + use-caches: false + run-on-tasks-for: [] + treeherder: + kind: test + platform: android-all/opt + symbol: nimbledroid + tier: 2 + worker: + docker-image: {in-tree: nimbledroid} + max-run-time: 600 + worker-type: b-android