Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Ensure the right dependencies are available on TaskCluster
Browse files Browse the repository at this point in the history
Unfortunately this "hack" is required because the add-ons
pipeline does not enable consumers to customize the installed
packages.
  • Loading branch information
Dexterp37 committed Mar 29, 2021
1 parent ab3c0f3 commit 3c015d3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -3,6 +3,7 @@
"version": "1.1.0",
"type": "module",
"scripts": {
"prebuild": "node scripts/setupTaskcluster.js",
"build": "rollup -c && npm run build-addon && web-ext --config=web-ext-config.cjs build --overwrite-dest && mv web-ext-artifacts/*.zip web-ext-artifacts/rally_core.xpi",
"build-addon": "npm run glean && rollup -c rollup.config.addon.js --config-enable-data-submission",
"build-local-addon": "npm run glean && rollup -c rollup.config.addon.js --config-disable-remote-settings --config-studies-list-url=/public/locally-available-studies.json",
Expand Down
24 changes: 24 additions & 0 deletions scripts/setupTaskcluster.js
@@ -0,0 +1,24 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import * as exec from "child_process";
import { promisify } from "util";

// Define an async/await version of "exec".
const execAsync = promisify(exec.exec);

if (!('TASK_ID' in process.env)) {
// If this is not running on TaskCluster, exit
// without an error code.
process.exit(0);
}

console.log("Running in TaskCluster. Running set-up.");

// The TaskCluster instance on the Mozilla add-ons pipeline
// does not allow image customization, so python3 venv cannot
// be installed. That package is required for Glean to build.
// We make sure to have all the dependencies in place when on
// TaskCluster by running the commands manually.
execAsync("apt-get -y install python3-venv");

0 comments on commit 3c015d3

Please sign in to comment.