From 8a0ebc4ade1d67e8290c516ed3e601a72e2ca0e9 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Thu, 12 Mar 2015 15:39:32 +0100 Subject: [PATCH] prscript: improve command line You can now directly access to docker related command: qa/prscript.py -C # create container qa/prscript.py -s # start container qa/prscript.py -S # stop container The build option does not change: qa/prscript.pu -l -d MY_BRANCH # build test of branch MY_BRANCH --- qa/prscript.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qa/prscript.py b/qa/prscript.py index e7c5118261..626dafdf4a 100755 --- a/qa/prscript.py +++ b/qa/prscript.py @@ -65,19 +65,23 @@ if GOT_DOCKER: parser.add_argument('-C', '--create', action='store_const', const=True, help='create docker container', default=False) parser.add_argument('-s', '--start', action='store_const', const=True, help='start docker container', default=False) parser.add_argument('-S', '--stop', action='store_const', const=True, help='stop docker container', default=False) -parser.add_argument('branch', metavar='branch', help='github branch to build') +parser.add_argument('branch', metavar='branch', help='github branch to build', nargs='?') args = parser.parse_args() username = args.username password = args.password cookie = None +if GOT_DOCKER: + if args.create or args.start or args.stop: + args.docker = True + args.local = True + if args.docker: BASE_URI="http://localhost:8010/" BUILDERS_LIST = ["gcc", "clang", "debug", "features", "profiling", "pcaps"] else: BUILDERS_LIST = [username, username + "-pcap"] - BUILDERS_URI=BASE_URI+"builders/" JSON_BUILDERS_URI=BASE_URI+"json/builders/" @@ -244,6 +248,10 @@ if GOT_DOCKER: if args.stop: StopContainer() +if not args.branch: + print "You need to specify a branch for this mode" + sys.exit(-1) + # submit buildbot form to build current branch on the devel builder if not args.check: if not args.docker: