Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Side by Side Diff: tools/push-to-trunk/chromium_roll.py

Issue 594773003: Refactoring: Remove global configs in release scripts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove global configs. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 the V8 project authors. All rights reserved. 2 # Copyright 2014 the V8 project authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 import os 7 import os
8 import sys 8 import sys
9 9
10 from common_includes import * 10 from common_includes import *
11 11
12 CHROMIUM = "CHROMIUM"
13
14 CONFIG = {
15 PERSISTFILE_BASENAME: "/tmp/v8-chromium-roll-tempfile",
16 }
17
18 12
19 class Preparation(Step): 13 class Preparation(Step):
20 MESSAGE = "Preparation." 14 MESSAGE = "Preparation."
21 15
22 def RunStep(self): 16 def RunStep(self):
23 # Update v8 remote tracking branches. 17 # Update v8 remote tracking branches.
24 self.GitFetchOrigin() 18 self.GitFetchOrigin()
25 19
26 20
27 class DetectLastPush(Step): 21 class DetectLastPush(Step):
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 103
110 class CleanUp(Step): 104 class CleanUp(Step):
111 MESSAGE = "Done!" 105 MESSAGE = "Done!"
112 106
113 def RunStep(self): 107 def RunStep(self):
114 print("Congratulations, you have successfully rolled the push r%s it into " 108 print("Congratulations, you have successfully rolled the push r%s it into "
115 "Chromium. Please don't forget to update the v8rel spreadsheet." 109 "Chromium. Please don't forget to update the v8rel spreadsheet."
116 % self["trunk_revision"]) 110 % self["trunk_revision"])
117 111
118 # Clean up all temporary files. 112 # Clean up all temporary files.
119 Command("rm", "-f %s*" % self._config[PERSISTFILE_BASENAME]) 113 Command("rm", "-f %s*" % self._config["PERSISTFILE_BASENAME"])
120 114
121 115
122 class ChromiumRoll(ScriptsBase): 116 class ChromiumRoll(ScriptsBase):
123 def _PrepareOptions(self, parser): 117 def _PrepareOptions(self, parser):
124 parser.add_argument("-c", "--chromium", required=True, 118 parser.add_argument("-c", "--chromium", required=True,
125 help=("The path to your Chromium src/ " 119 help=("The path to your Chromium src/ "
126 "directory to automate the V8 roll.")) 120 "directory to automate the V8 roll."))
127 parser.add_argument("-l", "--last-push", 121 parser.add_argument("-l", "--last-push",
128 help="The git commit ID of the last push to trunk.") 122 help="The git commit ID of the last push to trunk.")
129 parser.add_argument("--use-commit-queue", 123 parser.add_argument("--use-commit-queue",
130 help="Check the CQ bit on upload.", 124 help="Check the CQ bit on upload.",
131 default=False, action="store_true") 125 default=False, action="store_true")
132 126
133 def _ProcessOptions(self, options): # pragma: no cover 127 def _ProcessOptions(self, options): # pragma: no cover
134 if not options.author or not options.reviewer: 128 if not options.author or not options.reviewer:
135 print "A reviewer (-r) and an author (-a) are required." 129 print "A reviewer (-r) and an author (-a) are required."
136 return False 130 return False
137 131
138 options.requires_editor = False 132 options.requires_editor = False
139 options.force = True 133 options.force = True
140 options.manual = False 134 options.manual = False
141 return True 135 return True
142 136
137 def _Config(self):
138 return {
139 "PERSISTFILE_BASENAME": "/tmp/v8-chromium-roll-tempfile",
140 }
141
143 def _Steps(self): 142 def _Steps(self):
144 return [ 143 return [
145 Preparation, 144 Preparation,
146 DetectLastPush, 145 DetectLastPush,
147 DetermineV8Sheriff, 146 DetermineV8Sheriff,
148 SwitchChromium, 147 SwitchChromium,
149 UpdateChromiumCheckout, 148 UpdateChromiumCheckout,
150 UploadCL, 149 UploadCL,
151 SwitchV8, 150 SwitchV8,
152 CleanUp, 151 CleanUp,
153 ] 152 ]
154 153
155 154
156 if __name__ == "__main__": # pragma: no cover 155 if __name__ == "__main__": # pragma: no cover
157 sys.exit(ChromiumRoll(CONFIG).Run()) 156 sys.exit(ChromiumRoll().Run())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698