Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 """Recipe to build windows depot_tools bootstrap zipfile.""" | |
| 6 | |
| 7 DEPS = [ | |
| 8 'recipe_engine/path', | |
| 9 'recipe_engine/platform', | |
| 10 'recipe_engine/properties', | |
| 11 'recipe_engine/step', | |
| 12 | |
| 13 'depot_tools/git', | |
| 14 | |
| 15 'file', | |
| 16 'gsutil', | |
| 17 'zip', | |
| 18 ] | |
| 19 | |
| 20 from recipe_engine.recipe_api import Property | |
| 21 | |
| 22 REPO_URL='https://chromium.googlesource.com/chromium/tools/depot_tools.git' | |
| 23 | |
| 24 PROPERTIES = { | |
| 25 'revision': Property( | |
| 26 kind=str, help='The revision of depot_tools to check out'), | |
| 27 } | |
| 28 | |
| 29 def RunSteps(api, revision): | |
| 30 # prepare the output dir and zip paths | |
| 31 api.path['checkout'] = api.path['slave_build'].join('depot_tools') | |
| 32 zip_out = api.path['slave_build'].join('depot_tools.zip') | |
| 33 | |
| 34 # clean up any previous stuff | |
| 35 api.file.rmtree('rm depot_tools', api.path['checkout']) | |
| 36 api.file.remove('rm depot_tools.zip', zip_out, ok_ret=(0, 1)) | |
| 37 | |
| 38 # generate the new directory | |
| 39 api.step('mk depot_tools', ['mkdir', api.path['checkout']]) | |
| 40 | |
| 41 # clone + checkout depot_tools | |
| 42 api.git('clone', '--single-branch', '-n', REPO_URL, api.path['checkout']) | |
|
dnj
2016/04/01 14:40:01
nit: Maybe nested step here?
iannucci
2016/04/01 18:01:36
done and above
| |
| 43 api.git('config', 'core.autocrlf', 'false', name='set autocrlf') | |
| 44 api.git('config', 'core.filemode', 'false', name='set filemode') | |
| 45 api.git('config', 'core.symlinks', 'false', name='set symlinks') | |
| 46 api.git('checkout', 'origin/master') | |
| 47 api.git('reset', '--hard', revision) | |
| 48 api.git('reflog', 'expire', '--all') | |
|
dnj
2016/04/01 14:40:01
Might be worth adding this sort of thing to the Gi
iannucci
2016/04/01 18:01:36
I'm actually not sure where else it would be usefu
| |
| 49 api.git('gc', '--aggressive', '--prune=all') | |
| 50 | |
| 51 # zip + upload repo | |
| 52 api.zip.directory('zip it up', api.path['checkout'], zip_out) | |
| 53 api.gsutil.upload(zip_out, 'chrome-infra', 'depot_tools.zip', | |
| 54 args=['-a', 'public-read'], unauthenticated_url=True) | |
| 55 | |
| 56 # upload html docs | |
| 57 api.gsutil(['cp', '-r', '-z', 'html', '-a', 'public-read', | |
| 58 api.path['checkout'].join('man', 'html'), | |
| 59 'gs://chrome-infra-docs/flat/depot_tools/docs/'], | |
|
dnj
2016/04/01 14:40:01
nit: make this a constant up top
iannucci
2016/04/01 18:01:36
done
| |
| 60 name='upload docs') | |
| 61 | |
| 62 | |
| 63 def GenTests(api): | |
| 64 yield api.test('basic') + api.properties(revision='deadbeef') | |
| OLD | NEW |