Changeset View
Changeset View
Standalone View
Standalone View
contrib/gitian-build.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
import argparse | import argparse | ||||
import multiprocessing | |||||
import os | import os | ||||
import subprocess | import subprocess | ||||
import sys | import sys | ||||
def setup(): | def setup(): | ||||
global args, workdir | global args, workdir | ||||
programs = ['ruby', 'git', 'apt-cacher-ng', 'make', 'wget'] | programs = ['ruby', 'git', 'apt-cacher-ng', 'make', 'wget'] | ||||
▲ Show 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | def verify(): | ||||
subprocess.check_call(['bin/gverify', '-v', '-d', '../gitian.sigs/', '-r', args.version + | subprocess.check_call(['bin/gverify', '-v', '-d', '../gitian.sigs/', '-r', args.version + | ||||
'-osx-signed', '../bitcoin-abc/contrib/gitian-descriptors/gitian-osx-signer.yml']) | '-osx-signed', '../bitcoin-abc/contrib/gitian-descriptors/gitian-osx-signer.yml']) | ||||
os.chdir(workdir) | os.chdir(workdir) | ||||
def main(): | def main(): | ||||
global args, workdir | global args, workdir | ||||
num_cpus = multiprocessing.cpu_count() | |||||
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', | parser.add_argument('-c', '--commit', action='store_true', dest='commit', | ||||
help='Indicate that the version argument is for a commit or branch') | help='Indicate that the version argument is for a commit or branch') | ||||
parser.add_argument('-p', '--pull', action='store_true', dest='pull', | 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') | 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-ABC/bitcoin-abc.git', | parser.add_argument('-u', '--url', dest='url', default='https://github.com/Bitcoin-ABC/bitcoin-abc.git', | ||||
help='Specify the URL of the repository. Default is %(default)s') | help='Specify the URL of the repository. Default is %(default)s') | ||||
parser.add_argument('-v', '--verify', action='store_true', | parser.add_argument('-v', '--verify', action='store_true', | ||||
dest='verify', help='Verify the Gitian build') | dest='verify', help='Verify the Gitian build') | ||||
parser.add_argument('-b', '--build', action='store_true', | parser.add_argument('-b', '--build', action='store_true', | ||||
dest='build', help='Do a Gitian build') | dest='build', help='Do a Gitian build') | ||||
parser.add_argument('-s', '--sign', action='store_true', dest='sign', | parser.add_argument('-s', '--sign', action='store_true', dest='sign', | ||||
help='Make signed binaries for Windows and MacOS') | help='Make signed binaries for Windows and MacOS') | ||||
parser.add_argument('-B', '--buildsign', action='store_true', | parser.add_argument('-B', '--buildsign', action='store_true', | ||||
dest='buildsign', help='Build both signed and unsigned binaries') | dest='buildsign', help='Build both signed and unsigned binaries') | ||||
parser.add_argument('-o', '--os', dest='os', default='lwm', | parser.add_argument('-o', '--os', dest='os', default='lwm', | ||||
help='Specify which Operating Systems the build is for. Default is %(default)s. l for Linux, w for Windows, m for MacOS') | help='Specify which Operating Systems the build is for. Default is %(default)s. l for Linux, w for Windows, m for MacOS') | ||||
parser.add_argument('-j', '--jobs', dest='jobs', default='2', | parser.add_argument('-j', '--jobs', dest='jobs', default=str(num_cpus), | ||||
help='Number of processes to use. Default %(default)s') | help='Number of processes to use. Default %(default)s') | ||||
parser.add_argument('-m', '--memory', dest='memory', default='2000', | parser.add_argument('-m', '--memory', dest='memory', default='2000', | ||||
help='Memory to allocate in MiB. Default %(default)s') | help='Memory to allocate in MiB. Default %(default)s') | ||||
parser.add_argument('-k', '--kvm', action='store_true', | parser.add_argument('-k', '--kvm', action='store_true', | ||||
dest='kvm', help='Use KVM instead of LXC') | dest='kvm', help='Use KVM instead of LXC') | ||||
parser.add_argument('-d', '--docker', action='store_true', | parser.add_argument('-d', '--docker', action='store_true', | ||||
dest='docker', help='Use Docker instead of LXC') | dest='docker', help='Use Docker instead of LXC') | ||||
parser.add_argument('-S', '--setup', action='store_true', dest='setup', | parser.add_argument('-S', '--setup', action='store_true', dest='setup', | ||||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |