mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-29 15:29:14 +01:00
contrib: Support github pull request gitian-build
This commit is contained in:
@@ -135,6 +135,7 @@ def main():
|
|||||||
|
|
||||||
parser = argparse.ArgumentParser(usage='%(prog)s [options] signer version')
|
parser = argparse.ArgumentParser(usage='%(prog)s [options] signer version')
|
||||||
parser.add_argument('-c', '--commit', action='store_true', dest='commit', help='Indicate that the version argument is for a commit or branch')
|
parser.add_argument('-c', '--commit', action='store_true', dest='commit', help='Indicate that the version argument is for a commit or branch')
|
||||||
|
parser.add_argument('-p', '--pull', action='store_true', dest='pull', help='Indicate that the version argument is the number of a github repository pull request')
|
||||||
parser.add_argument('-u', '--url', dest='url', default='https://github.com/bitcoin/bitcoin', help='Specify the URL of the repository. Default is %(default)s')
|
parser.add_argument('-u', '--url', dest='url', default='https://github.com/bitcoin/bitcoin', help='Specify the URL of the repository. Default is %(default)s')
|
||||||
parser.add_argument('-v', '--verify', action='store_true', dest='verify', help='Verify the Gitian build')
|
parser.add_argument('-v', '--verify', action='store_true', dest='verify', help='Verify the Gitian build')
|
||||||
parser.add_argument('-b', '--build', action='store_true', dest='build', help='Do a Gitian build')
|
parser.add_argument('-b', '--build', action='store_true', dest='build', help='Do a Gitian build')
|
||||||
@@ -196,13 +197,21 @@ def main():
|
|||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
# Add leading 'v' for tags
|
# Add leading 'v' for tags
|
||||||
|
if args.commit and args.pull:
|
||||||
|
raise Exception('Cannot have both commit and pull')
|
||||||
args.commit = ('' if args.commit else 'v') + args.version
|
args.commit = ('' if args.commit else 'v') + args.version
|
||||||
print(args.commit)
|
|
||||||
|
|
||||||
if args.setup:
|
if args.setup:
|
||||||
setup()
|
setup()
|
||||||
|
|
||||||
os.chdir('bitcoin')
|
os.chdir('bitcoin')
|
||||||
|
if args.pull:
|
||||||
|
subprocess.check_call(['git', 'fetch', args.url, 'refs/pull/'+args.version+'/merge'])
|
||||||
|
os.chdir('../gitian-builder/inputs/bitcoin')
|
||||||
|
subprocess.check_call(['git', 'fetch', args.url, 'refs/pull/'+args.version+'/merge'])
|
||||||
|
args.commit = subprocess.check_output(['git', 'show', '-s', '--format=%H', 'FETCH_HEAD'], universal_newlines=True).strip()
|
||||||
|
args.version = 'pull-' + args.version
|
||||||
|
print(args.commit)
|
||||||
subprocess.check_call(['git', 'fetch'])
|
subprocess.check_call(['git', 'fetch'])
|
||||||
subprocess.check_call(['git', 'checkout', args.commit])
|
subprocess.check_call(['git', 'checkout', args.commit])
|
||||||
os.chdir(workdir)
|
os.chdir(workdir)
|
||||||
|
|||||||
Reference in New Issue
Block a user