testing/taskcluster/tasks/decision/try.yml
author Dustin J. Mitchell <dustin@mozilla.com>
Mon, 16 May 2016 22:42:10 +0000
changeset 297660 c17e66a20cb3e167420df885f94c6c010d1f6089
parent 297028 d15d4a592be044450deadf106f9db6d06c21ea41
child 298281 13753a81970ad0e15d8bd921338219c975c02064
permissions -rw-r--r--
Bug 1258497: use `taskgraph decision` in decision task; r=gps MozReview-Commit-ID: 9STbp4EPMrT

---
metadata:
  name: 'Taskcluster decision task for {{project}}'
  description: |
    Try push for {{owner}}.
  owner: mozilla-taskcluster-maintenance@mozilla.com
  source: "{{{source}}}"

scopes:
  # Note the below scopes are insecure however these get overriden on the server
  # side to whatever scopes are set by mozilla-taskcluster.
  - queue:*
  - docker-worker:*
  - scheduler:*

tasks:
  - taskId: '{{#as_slugid}}decision task{{/as_slugid}}'
    reruns: 3
    task:
      created: '{{now}}'
      deadline: '{{#from_now}}1 day{{/from_now}}'
      expires: '{{#from_now}}14 day{{/from_now}}'
      metadata:
        owner: mozilla-taskcluster-maintenance@mozilla.com
        source: {{{source}}}
        name: "[tc] Initial decision task for try"
        description: |
          Create the task-graph for a try push

      workerType: "gecko-decision"
      provisionerId: "aws-provisioner-v1"

      tags:
        createdForUser: {{owner}}

      scopes:
        # Bug 1269443: cache scopes, etc. must be listed explicitly
        - "docker-worker:cache:level-1-*"
        - "docker-worker:cache:tooltool-cache"
        - "secrets:get:project/taskcluster/gecko/hgfingerprint"
        - "assume:repo:hg.mozilla.org/try:*"

      routes:
        - "index.gecko.v2.{{project}}.latest.firefox.decision"
        - "tc-treeherder.{{project}}.{{revision_hash}}"
        - "tc-treeherder-stage.{{project}}.{{revision_hash}}"

      payload:
        env:
          GECKO_BASE_REPOSITORY: 'https://hg.mozilla.org/mozilla-central'
          GECKO_HEAD_REPOSITORY: '{{{url}}}'
          GECKO_HEAD_REF: '{{revision}}'
          GECKO_HEAD_REV: '{{revision}}'

        cache:
          # The taskcluster-vcs tooling stores the large clone caches in this
          # directory and will reuse them for new requests this saves about 20s~ and
          # is the most generic cache possible.
          level-{{level}}-{{project}}-tc-vcs-public-sources: /home/worker/.tc-vcs/
          level-{{level}}-{{project}}-gecko-decision: /home/worker/workspace

        features:
          taskclusterProxy: true

        # Note: This task is built server side without the context or tooling that
        # exist in tree so we must hard code the version
        image: 'taskcluster/decision:0.1.0'

        # Virtually no network or other potentially risky operations happen as part
        # of the task timeout aside from the initial clone. We intentionally have
        # set this to a lower value _all_ decision tasks should use a root
        # repository which is cached.
        maxRunTime: 1800

        command:
          - /bin/bash
          - -cx
          - >
            mkdir -p /home/worker/artifacts &&
            checkout-gecko workspace &&
            cd workspace/gecko &&
            ln -s /home/worker/artifacts artifacts &&
            ./mach taskgraph decision
            --target-tasks-method=try_option_syntax
            --pushlog-id='{{pushlog_id}}'
            --project='{{project}}'
            --message='{{comment}}'
            --owner='{{owner}}'
            --level='{{level}}'
            --base-repository='https://hg.mozilla.org/mozilla-central'
            --head-repository='{{{url}}}'
            --head-ref='{{revision}}'
            --head-rev='{{revision}}'
            --revision-hash='{{revision_hash}}'

        artifacts:
          'public':
            type: 'directory'
            path: '/home/worker/artifacts'
            expires: '{{#from_now}}7 days{{/from_now}}'

      extra:
        treeherder:
          symbol: D
          revision: '{{revision}}'
          revision_hash: '{{revision_hash}}'