]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
prscript: improve command line
authorEric Leblond <eric@regit.org>
Thu, 12 Mar 2015 14:39:32 +0000 (15:39 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 7 Apr 2015 09:03:53 +0000 (11:03 +0200)
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

index e7c5118261c0f4cfaa9e61147e3e66e2990a9f56..626dafdf4a71f371ada38dbcd9f9a91a33aa9595 100755 (executable)
@@ -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: