Bug 1384210 - Add comm-central checkout support to taskcluster's run-task; r=gps

MozReview-Commit-ID: LxjYLdzmNO3

--HG--
extra : rebase_source : febd7be321ca1acb9193c4893e3a122d6d3a8d58
This commit is contained in:
Tom Prince 2017-07-25 10:17:03 -06:00
parent 4a49a600af
commit b43eafa130

View File

@ -177,6 +177,8 @@ def main(args):
help='Directory to recursively chown to --user:--group')
parser.add_argument('--vcs-checkout',
help='Directory where Gecko checkout should be created')
parser.add_argument('--comm-checkout',
help='Directory where Comm checkout should be created')
parser.add_argument('--tools-checkout',
help='Directory where build/tools checkout should be created')
parser.add_argument('--fetch-hgfingerprint', action='store_true',
@ -345,6 +347,26 @@ def main(args):
# This is non-deterministic!
branch=b'default')
# Checkout the repository, setting the COMM_HEAD_REV to the current
# revision hash. Revision hashes have priority over symbolic revisions. We
# disallow running tasks with symbolic revisions unless they have been
# resolved by a checkout.
if args.comm_checkout:
base_repo = os.environ.get('COMM_BASE_REPOSITORY')
os.environ['COMM_HEAD_REV'] = vcs_checkout(
os.environ['COMM_HEAD_REPOSITORY'],
args.comm_checkout,
os.environ['HG_STORE_PATH'],
base_repo=base_repo,
revision=os.environ.get('COMM_HEAD_REV'),
branch=os.environ.get('COMM_HEAD_REF'))
elif not os.environ.get('COMM_HEAD_REV') and \
os.environ.get('COMM_HEAD_REF'):
print('task should be defined in terms of non-symbolic revision')
return 1
return run_and_prefix_output(b'task', task_args)