Bug 1589684 - Let taskgraph handle params["head_tag"] (#6116)
parent
33ac75d166
commit
7f65a22702
|
@ -8,7 +8,7 @@ tasks:
|
||||||
- $let:
|
- $let:
|
||||||
taskgraph:
|
taskgraph:
|
||||||
branch: taskgraph
|
branch: taskgraph
|
||||||
revision: 09d4c6dec78d17beb186eef1f79c1ab712ccc433
|
revision: bb532a33ad32213f3a396346b26abd28fb87a975
|
||||||
trustDomain: mobile
|
trustDomain: mobile
|
||||||
in:
|
in:
|
||||||
$let:
|
$let:
|
||||||
|
@ -77,6 +77,11 @@ tasks:
|
||||||
else:
|
else:
|
||||||
$if: 'tasks_for in ["cron", "action"]'
|
$if: 'tasks_for in ["cron", "action"]'
|
||||||
then: '${push.revision}'
|
then: '${push.revision}'
|
||||||
|
head_tag:
|
||||||
|
$if: 'tasks_for == "github-release"'
|
||||||
|
then: '${event.release.tag_name}'
|
||||||
|
else: ''
|
||||||
|
|
||||||
ownTaskId:
|
ownTaskId:
|
||||||
$if: '"github" in tasks_for'
|
$if: '"github" in tasks_for'
|
||||||
then: {$eval: as_slugid("decision_task")}
|
then: {$eval: as_slugid("decision_task")}
|
||||||
|
@ -186,6 +191,7 @@ tasks:
|
||||||
MOBILE_HEAD_REPOSITORY: '${repoUrl}'
|
MOBILE_HEAD_REPOSITORY: '${repoUrl}'
|
||||||
MOBILE_HEAD_REF: '${head_branch}'
|
MOBILE_HEAD_REF: '${head_branch}'
|
||||||
MOBILE_HEAD_REV: '${head_sha}'
|
MOBILE_HEAD_REV: '${head_sha}'
|
||||||
|
MOBILE_HEAD_TAG: '${head_tag}'
|
||||||
MOBILE_REPOSITORY_TYPE: git
|
MOBILE_REPOSITORY_TYPE: git
|
||||||
TASKGRAPH_BASE_REPOSITORY: https://hg.mozilla.org/ci/taskgraph
|
TASKGRAPH_BASE_REPOSITORY: https://hg.mozilla.org/ci/taskgraph
|
||||||
TASKGRAPH_HEAD_REPOSITORY: https://hg.mozilla.org/ci/${taskgraph.branch}
|
TASKGRAPH_HEAD_REPOSITORY: https://hg.mozilla.org/ci/${taskgraph.branch}
|
||||||
|
@ -203,9 +209,6 @@ tasks:
|
||||||
ACTION_TASK_ID: {$json: {$eval: 'taskId'}} # taskId of the target task (JSON-encoded)
|
ACTION_TASK_ID: {$json: {$eval: 'taskId'}} # taskId of the target task (JSON-encoded)
|
||||||
ACTION_INPUT: {$json: {$eval: 'input'}}
|
ACTION_INPUT: {$json: {$eval: 'input'}}
|
||||||
ACTION_CALLBACK: '${action.cb_name}'
|
ACTION_CALLBACK: '${action.cb_name}'
|
||||||
- $if: 'tasks_for == "github-release"'
|
|
||||||
then:
|
|
||||||
MOBILE_HEAD_TAG: '${event.release.tag_name}'
|
|
||||||
features:
|
features:
|
||||||
taskclusterProxy: true
|
taskclusterProxy: true
|
||||||
chainOfTrust: true
|
chainOfTrust: true
|
||||||
|
@ -248,6 +251,7 @@ tasks:
|
||||||
--head-repository="$MOBILE_HEAD_REPOSITORY"
|
--head-repository="$MOBILE_HEAD_REPOSITORY"
|
||||||
--head-ref="$MOBILE_HEAD_REF"
|
--head-ref="$MOBILE_HEAD_REF"
|
||||||
--head-rev="$MOBILE_HEAD_REV"
|
--head-rev="$MOBILE_HEAD_REV"
|
||||||
|
--head-tag="$MOBILE_HEAD_TAG"
|
||||||
--repository-type="$MOBILE_REPOSITORY_TYPE"
|
--repository-type="$MOBILE_REPOSITORY_TYPE"
|
||||||
--tasks-for='${tasks_for}'
|
--tasks-for='${tasks_for}'
|
||||||
${extraArgs}
|
${extraArgs}
|
||||||
|
|
|
@ -24,7 +24,6 @@ def register(graph_config):
|
||||||
"""
|
"""
|
||||||
_import_modules(["job", "worker_types", "routes", "target_tasks"])
|
_import_modules(["job", "worker_types", "routes", "target_tasks"])
|
||||||
extend_parameters_schema({
|
extend_parameters_schema({
|
||||||
Required("head_tag"): text_type,
|
|
||||||
Required("pull_request_number"): Any(All(int, Range(min=1)), None),
|
Required("pull_request_number"): Any(All(int, Range(min=1)), None),
|
||||||
Required("release_type"): text_type,
|
Required("release_type"): text_type,
|
||||||
Required("release_version"): text_type,
|
Required("release_version"): text_type,
|
||||||
|
@ -37,8 +36,7 @@ def _import_modules(modules):
|
||||||
|
|
||||||
|
|
||||||
def get_decision_parameters(graph_config, parameters):
|
def get_decision_parameters(graph_config, parameters):
|
||||||
head_tag = os.environ.get("MOBILE_HEAD_TAG", "").decode('utf-8')
|
head_tag = parameters["head_tag"].decode("utf-8")
|
||||||
parameters["head_tag"] = head_tag
|
|
||||||
parameters["release_type"] = _resolve_release_type(head_tag)
|
parameters["release_type"] = _resolve_release_type(head_tag)
|
||||||
parameters["release_version"] = read_version_file()
|
parameters["release_version"] = read_version_file()
|
||||||
if head_tag:
|
if head_tag:
|
||||||
|
|
Loading…
Reference in New Issue