Bug 1277205 - Forward {{project}} to properly build scopes in decision task r=me
authorTim Taubert <ttaubert@mozilla.com>
Thu, 30 Jun 2016 10:18:26 +0200
changeset 12349 269378b3369211819db12a9e030307e99216d26e
parent 12348 535ff196fc55bc53e9ddcc009f32658bf599108a
child 12350 b48a3a0f914c9c5fcc3dd6c0a86dd564294faba6
push id1363
push userttaubert@mozilla.com
push dateThu, 30 Jun 2016 08:22:04 +0000
reviewersme
bugs1277205
Bug 1277205 - Forward {{project}} to properly build scopes in decision task r=me
.taskcluster.yml
automation/taskcluster/graph/build.js
--- a/.taskcluster.yml
+++ b/.taskcluster.yml
@@ -57,16 +57,17 @@ tasks:
         - "tc-treeherder.v2.{{project}}.{{revision}}.{{pushlog_id}}"
 
       payload:
         image: "ttaubert/nss-ci:0.0.17"
 
         env:
           TC_OWNER: {{owner}}
           TC_SOURCE: {{{source}}}
+          TC_PROJECT: {{project}}
           NSS_PUSHLOG_ID: '{{pushlog_id}}'
           NSS_HEAD_REPOSITORY: '{{{url}}}'
           NSS_HEAD_REVISION: '{{revision}}'
 
         maxRunTime: 1800
 
         command:
           - bash
--- a/automation/taskcluster/graph/build.js
+++ b/automation/taskcluster/graph/build.js
@@ -7,16 +7,17 @@ var path = require("path");
 var merge = require("merge");
 var yaml = require("js-yaml");
 var slugid = require("slugid");
 var flatmap = require("flatmap");
 
 // Default values for debugging.
 var TC_OWNER = process.env.TC_OWNER || "{{tc_owner}}";
 var TC_SOURCE = process.env.TC_SOURCE || "{{tc_source}}";
+var TC_PROJECT = process.env.TC_PROJECT || "{{tc_project}}";
 var NSS_PUSHLOG_ID = process.env.NSS_PUSHLOG_ID || "{{nss_pushlog_id}}";
 var NSS_HEAD_REPOSITORY = process.env.NSS_HEAD_REPOSITORY || "{{nss_head_repo}}";
 var NSS_HEAD_REVISION = process.env.NSS_HEAD_REVISION || "{{nss_head_rev}}";
 
 // Register custom YAML types.
 var YAML_SCHEMA = yaml.Schema.create([
   // Point in time at $now + x hours.
   new yaml.Type('!from_now', {
@@ -61,18 +62,18 @@ function parseYamlFile(file, fallback) {
 
 // Add base information to the given task.
 function decorateTask(task) {
   // Assign random task id.
   task.taskId = slugid.v4();
 
   // TreeHerder routes.
   task.task.routes = [
-    "tc-treeherder-stage.v2.nss." + NSS_HEAD_REVISION + "." + NSS_PUSHLOG_ID,
-    "tc-treeherder.v2.nss." + NSS_HEAD_REVISION + "." + NSS_PUSHLOG_ID
+    "tc-treeherder-stage.v2." + TC_PROJECT + "." + NSS_HEAD_REVISION + "." + NSS_PUSHLOG_ID,
+    "tc-treeherder.v2." + TC_PROJECT + "." + NSS_HEAD_REVISION + "." + NSS_PUSHLOG_ID
   ];
 }
 
 // Generate all tasks for a given build.
 function generateBuildTasks(platform, file) {
   var dir = path.join(__dirname, "./" + platform);
 
   // Parse base definitions.