prscript: add --norebase option

If --norebase option is provided, the prscript will start a build
that can be used to check if an out-of-sync branch pass the test.
pull/758/head
Eric Leblond 13 years ago committed by Victor Julien
parent 4d6b48ea9e
commit 55108167e5

@ -35,6 +35,7 @@ parser.add_argument('-u', '--username', dest='username', help='github and buildb
parser.add_argument('-p', '--password', dest='password', help='buildbot password') parser.add_argument('-p', '--password', dest='password', help='buildbot password')
parser.add_argument('-c', '--check', action='store_const', const=True, help='only check last build', default=False) parser.add_argument('-c', '--check', action='store_const', const=True, help='only check last build', default=False)
parser.add_argument('-v', '--verbose', action='store_const', const=True, help='verbose output', default=False) parser.add_argument('-v', '--verbose', action='store_const', const=True, help='verbose output', default=False)
parser.add_argument('--norebase', action='store_const', const=True, help='do not test if branch is in sync with master', default=False)
parser.add_argument('-r', '--repository', dest='repository', default='suricata', help='name of suricata repository on github') parser.add_argument('-r', '--repository', dest='repository', default='suricata', help='name of suricata repository on github')
parser.add_argument('branch', metavar='branch', help='github branch to build') parser.add_argument('branch', metavar='branch', help='github branch to build')
args = parser.parse_args() args = parser.parse_args()
@ -132,10 +133,13 @@ def WaitForBuildResult(builder, buildid, extension=""):
print "Build failure: " + BUILDERS_URI + username + extension + '/builds/' + str(buildid) print "Build failure: " + BUILDERS_URI + username + extension + '/builds/' + str(buildid)
return res return res
# check that github branch and inliniac master branch are sync # check that github branch and inliniac master branch are sync
if TestRepoSync(args.branch) == -1: if TestRepoSync(args.branch) == -1:
print "Branch " + args.branch + " is not in sync with inliniac's master branch. Rebase needed." if args.norebase:
sys.exit(-1) print "Branch " + args.branch + " is not in sync with inliniac's master branch. Continuing due to --norebase option."
else:
print "Branch " + args.branch + " is not in sync with inliniac's master branch. Rebase needed."
sys.exit(-1)
# submit buildbot form to build current branch on the devel builder # submit buildbot form to build current branch on the devel builder
if not args.check: if not args.check:
@ -183,9 +187,10 @@ if buildidpcap != -1:
res += WaitForBuildResult(username, buildidpcap, extension="-pcap") res += WaitForBuildResult(username, buildidpcap, extension="-pcap")
if res == 0: if res == 0:
print "You can copy/paste following lines into github PR" if not args.norebase:
print "- PR build: " + BUILDERS_URI + username + "/builds/" + str(buildid) print "You can copy/paste following lines into github PR"
print "- PR pcaps: " + BUILDERS_URI + username + "-pcap/builds/" + str(buildidpcap) print "- PR build: " + BUILDERS_URI + username + "/builds/" + str(buildid)
print "- PR pcaps: " + BUILDERS_URI + username + "-pcap/builds/" + str(buildidpcap)
sys.exit(0) sys.exit(0)
else: else:
sys.exit(-1) sys.exit(-1)

Loading…
Cancel
Save