aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/upload_skps.py
diff options
context:
space:
mode:
authorGravatar Eric Boren <borenet@google.com>2018-04-23 08:35:45 -0400
committerGravatar Eric Boren <borenet@google.com>2018-04-23 13:00:19 +0000
commit7817931a5c1035742dccae7d71e2083f12bf5a6e (patch)
tree01b501387d9a33987357be09923354af996fc5fb /infra/bots/upload_skps.py
parent32f8478ae9ecab4513fc65996df6231f22d2a672 (diff)
Switch RecreateSKPs and Bookmaker bots to use service accounts
Bug: skia: Change-Id: I59aefe7c7e7a6861b00f0e22310e7ceaff3d6d0e Reviewed-on: https://skia-review.googlesource.com/122944 Reviewed-by: Ravi Mistry <rmistry@google.com>
Diffstat (limited to 'infra/bots/upload_skps.py')
-rw-r--r--infra/bots/upload_skps.py40
1 files changed, 14 insertions, 26 deletions
diff --git a/infra/bots/upload_skps.py b/infra/bots/upload_skps.py
index dab91303c8..b7bb0cfb6f 100644
--- a/infra/bots/upload_skps.py
+++ b/infra/bots/upload_skps.py
@@ -13,19 +13,18 @@ import urllib2
import git_utils
-SKIA_COMMITTER_EMAIL = 'update-skps@skia.org'
-SKIA_COMMITTER_NAME = 'UpdateSKPs'
+
COMMIT_MSG = '''Update SKP version
Automatic commit by the RecreateSKPs bot.
-TBR=%s
+TBR=rmistry@google.com
NO_MERGE_BUILDS
-''' % SKIA_COMMITTER_EMAIL
+'''
SKIA_REPO = 'https://skia.googlesource.com/skia.git'
-def main(target_dir, gitcookies):
+def main(target_dir):
with git_utils.NewGitCheckout(repository=SKIA_REPO):
# First verify that there are no gen_tasks diffs.
gen_tasks = os.path.join(os.getcwd(), 'infra', 'bots', 'gen_tasks.go')
@@ -36,31 +35,20 @@ def main(target_dir, gitcookies):
'gen_tasks.go failed, not uploading SKP update:\n\n%s' % e.output)
sys.exit(1)
- # Skip GCE Auth in depot_tools/gerrit_utils.py. Use gitcookies instead.
- os.environ['SKIP_GCE_AUTH_FOR_GIT'] = 'True'
- os.environ['GIT_COOKIES_PATH'] = gitcookies
- os.environ['USE_CIPD_GCE_AUTH'] = 'True'
# Upload the new version, land the update CL as the update-skps user.
- config_dict = {
- 'user.name': SKIA_COMMITTER_NAME,
- 'user.email': SKIA_COMMITTER_EMAIL,
- 'http.cookiefile': gitcookies,
- }
- with git_utils.GitLocalConfig(config_dict):
- with git_utils.GitBranch(branch_name='update_skp_version',
- commit_msg=COMMIT_MSG,
- commit_queue=True):
- upload_script = os.path.join(
- os.getcwd(), 'infra', 'bots', 'assets', 'skp', 'upload.py')
- subprocess.check_call(['python', upload_script, '-t', target_dir])
- subprocess.check_call(['go', 'run', gen_tasks])
- subprocess.check_call([
- 'git', 'add', os.path.join('infra', 'bots', 'tasks.json')])
+ with git_utils.GitBranch(branch_name='update_skp_version',
+ commit_msg=COMMIT_MSG,
+ commit_queue=True):
+ upload_script = os.path.join(
+ os.getcwd(), 'infra', 'bots', 'assets', 'skp', 'upload.py')
+ subprocess.check_call(['python', upload_script, '-t', target_dir])
+ subprocess.check_call(['go', 'run', gen_tasks])
+ subprocess.check_call([
+ 'git', 'add', os.path.join('infra', 'bots', 'tasks.json')])
if '__main__' == __name__:
parser = argparse.ArgumentParser()
parser.add_argument("--target_dir")
- parser.add_argument("--gitcookies")
args = parser.parse_args()
- main(args.target_dir, args.gitcookies)
+ main(args.target_dir)