1
0
Fork 0

Fix branch in indexes

master
Johan Lorenzo 2019-04-02 15:53:23 +02:00 committed by Colin Lee
parent 7c1da688eb
commit d3f215717b
3 changed files with 22 additions and 8 deletions

View File

@ -99,6 +99,7 @@ tasks:
MOBILE_HEAD_REV: ${head_rev}
MOBILE_TRIGGERED_BY: ${user}
SCHEDULER_ID: ${scheduler_id}
SHORT_HEAD_BRANCH: ${short_head_branch}
TASK_ID: ${decision_task_id}
TASKS_PRIORITY: ${tasks_priority}
TRUST_LEVEL: ${trust_level}

View File

@ -31,6 +31,7 @@ BUILDER = TaskBuilder(
task_id=os.environ.get('TASK_ID'),
repo_url=REPO_URL,
git_ref=os.environ.get('MOBILE_HEAD_BRANCH'),
short_head_branch=os.environ.get('SHORT_HEAD_BRANCH'),
commit=COMMIT,
owner="fenix-eng-notifications@mozilla.com",
source='{}/raw/{}/.taskcluster.yml'.format(REPO_URL, COMMIT),

View File

@ -18,12 +18,23 @@ _OFFICIAL_REPO_URL = 'https://github.com/mozilla-mobile/fenix'
class TaskBuilder(object):
def __init__(
self, task_id, repo_url, git_ref, commit, owner, source, scheduler_id, date_string,
tasks_priority='lowest', trust_level=1
self,
task_id,
repo_url,
git_ref,
short_head_branch,
commit,
owner,
source,
scheduler_id,
date_string,
tasks_priority='lowest',
trust_level=1
):
self.task_id = task_id
self.repo_url = repo_url
self.git_ref = git_ref
self.short_head_branch = short_head_branch
self.commit = commit
self.owner = owner
self.source = source
@ -130,7 +141,7 @@ class TaskBuilder(object):
def _craft_branch_routes(self, variant):
routes = []
if self.repo_url == _OFFICIAL_REPO_URL and self.git_ref == 'refs/heads/master':
if self.repo_url == _OFFICIAL_REPO_URL and self.short_head_branch == 'master':
architecture, build_type, product = \
_get_architecture_and_build_type_and_product_from_variant(variant)
product = convert_camel_case_into_kebab_case(product)
@ -138,17 +149,18 @@ class TaskBuilder(object):
routes = [
'index.project.mobile.fenix.branch.{}.revision.{}.{}.{}'.format(
self.git_ref, self.commit, product, postfix
self.short_head_branch, self.commit, product, postfix
),
'index.project.mobile.fenix.branch.{}.latest.{}.{}'.format(
self.git_ref, product, postfix
self.short_head_branch, product, postfix
),
'index.project.mobile.fenix.branch.{}.pushdate.{}.{}.{}.revision.{}.{}.{}'.format(
self.git_ref, self.date.year, self.date.month, self.date.day, self.commit,
product, postfix
self.short_head_branch, self.date.year, self.date.month, self.date.day,
self.commit, product, postfix
),
'index.project.mobile.fenix.branch.{}.pushdate.{}.{}.{}.latest.{}.{}'.format(
self.git_ref. self.date.year, self.date.month, self.date.day, product, postfix
self.short_head_branch. self.date.year, self.date.month, self.date.day,
product, postfix
),
]
return routes