Commit 42dcc6f4 authored by machenbach's avatar machenbach Committed by Commit bot

Switch to new branching model in auto-push script.

BUG=chromium:391261
LOG=n
TBR=tandrii@chromium.org
NOTRY=true

TEST=./script_test.py

Review URL: https://codereview.chromium.org/955613003

Cr-Commit-Position: refs/heads/master@{#26821}
parent 943dc631
...@@ -34,7 +34,7 @@ import sys ...@@ -34,7 +34,7 @@ import sys
import urllib import urllib
from common_includes import * from common_includes import *
import push_to_candidates import create_release
class Preparation(Step): class Preparation(Step):
...@@ -67,11 +67,11 @@ class LastReleaseBailout(Step): ...@@ -67,11 +67,11 @@ class LastReleaseBailout(Step):
return True return True
class PushToCandidates(Step): class CreateRelease(Step):
MESSAGE = "Pushing to candidates if specified." MESSAGE = "Creating release if specified."
def RunStep(self): def RunStep(self):
print "Pushing candidate %s to candidates." % self["candidate"] print "Creating release for %s." % self["candidate"]
args = [ args = [
"--author", self._options.author, "--author", self._options.author,
...@@ -83,16 +83,15 @@ class PushToCandidates(Step): ...@@ -83,16 +83,15 @@ class PushToCandidates(Step):
if self._options.work_dir: if self._options.work_dir:
args.extend(["--work-dir", self._options.work_dir]) args.extend(["--work-dir", self._options.work_dir])
# TODO(machenbach): Update the script before calling it.
if self._options.push: if self._options.push:
self._side_effect_handler.Call( self._side_effect_handler.Call(
push_to_candidates.PushToCandidates().Run, args) create_release.CreateRelease().Run, args)
class AutoPush(ScriptsBase): class AutoPush(ScriptsBase):
def _PrepareOptions(self, parser): def _PrepareOptions(self, parser):
parser.add_argument("-p", "--push", parser.add_argument("-p", "--push",
help="Push to candidates. Dry run if unspecified.", help="Create release. Dry run if unspecified.",
default=False, action="store_true") default=False, action="store_true")
def _ProcessOptions(self, options): def _ProcessOptions(self, options):
...@@ -112,7 +111,7 @@ class AutoPush(ScriptsBase): ...@@ -112,7 +111,7 @@ class AutoPush(ScriptsBase):
Preparation, Preparation,
FetchCandidate, FetchCandidate,
LastReleaseBailout, LastReleaseBailout,
PushToCandidates, CreateRelease,
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment