Skip to content
Snippets Groups Projects
Commit a08ff4da14d6 authored by Georges Racinet's avatar Georges Racinet
Browse files

push-release: functions / classes reordering

parent be9d7ede9813
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,17 @@
GITLAB_RAILS = '/opt/gitlab/embedded/service/gitlab-rails/'
class InvalidBuildNumber(RuntimeError):
pass
def call(cmd, simulate=True):
logger.info("Simulation mode, would run %r" if simulate else "Running %r",
cmd)
if not simulate:
subprocess.check_call(cmd)
class Releaser:
def __init__(self, simulate):
......@@ -63,9 +74,4 @@
call(('docker', 'push', img_tag), simulate=self.simulate)
parser = argparse.ArgumentParser(
"Create Docker image tags from the current testing, after some "
"verifications.")
def series(s):
......@@ -71,4 +77,5 @@
def series(s):
"""Validator for CLI args."""
if s == 'current':
return None
if re.match(r'^\d+-\d+$', s) is None:
......@@ -78,6 +85,11 @@
return s
parser = argparse.ArgumentParser(
"Create Docker image tags from the current testing, after some "
"verifications.")
parser.add_argument('-s', '--simulate', action='store_true')
parser.add_argument('-y', '--no-confirmation', action='store_true')
parser.add_argument('-l', '--logging-level', default='info')
......@@ -91,17 +103,6 @@
"Example values: 0-19, 0-20 or current")
class InvalidBuildNumber(RuntimeError):
pass
def call(cmd, simulate=True):
logger.info("Simulation mode, would run %r" if simulate else "Running %r",
cmd)
if not simulate:
subprocess.check_call(cmd)
parsed_args = parser.parse_args()
logging.basicConfig(level=getattr(logging, parsed_args.logging_level.upper()))
stable_series = parsed_args.series
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment