@ -5,7 +5,7 @@ import os
import subprocess
import sys
gsigs = ' https://git hub.com/monero-project /gitian.sigs.git'
gsigs = ' https://git .wownero.com/wownero /gitian.sigs.git'
gbrepo = ' https://github.com/devrandom/gitian-builder.git '
platforms = { ' l ' : [ ' Linux ' , ' linux ' , ' tar.bz2 ' ] ,
@ -31,10 +31,10 @@ def setup():
subprocess . check_call ( [ ' git ' , ' checkout ' , ' c0f77ca018cb5332bfd595e0aff0468f77542c23 ' ] )
os . makedirs ( ' inputs ' , exist_ok = True )
os . chdir ( ' inputs ' )
if os . path . isdir ( ' mo nero' ) :
# Remove the potentially stale mo nero dir. Otherwise you might face submodule mismatches.
subprocess . check_call ( [ ' rm ' , ' mo nero' , ' -fR ' ] )
subprocess . check_call ( [ ' git ' , ' clone ' , args . url , ' mo nero' ] )
if os . path . isdir ( ' wow nero' ) :
# Remove the potentially stale wow nero dir. Otherwise you might face submodule mismatches.
subprocess . check_call ( [ ' rm ' , ' wow nero' , ' -fR ' ] )
subprocess . check_call ( [ ' git ' , ' clone ' , args . url , ' wow nero' ] )
os . chdir ( ' .. ' )
make_image_prog = [ ' bin/make-base-vm ' , ' --suite ' , ' bionic ' , ' --arch ' , ' amd64 ' ]
if args . docker :
@ -66,10 +66,10 @@ def rebuild():
suffix = platforms [ i ] [ 2 ]
print ( ' \n Compiling ' + args . version + ' ' + os_name )
infile = ' inputs/ mo nero/contrib/gitian/gitian-' + tag_name + ' .yml '
subprocess . check_call ( [ ' bin/gbuild ' , ' -j ' , args . jobs , ' -m ' , args . memory , ' --commit ' , ' mo nero=' + args . commit , ' --url ' , ' mo nero=' + args . url , infile ] )
infile = ' inputs/ wow nero/contrib/gitian/gitian-' + tag_name + ' .yml '
subprocess . check_call ( [ ' bin/gbuild ' , ' -j ' , args . jobs , ' -m ' , args . memory , ' --commit ' , ' wow nero=' + args . commit , ' --url ' , ' wow nero=' + args . url , infile ] )
subprocess . check_call ( [ ' bin/gsign ' , ' -p ' , args . sign_prog , ' --signer ' , args . signer , ' --release ' , args . version + ' - ' + tag_name , ' --destination ' , ' ../sigs/ ' , infile ] )
subprocess . check_call ( ' mv build/out/ mo nero-*.' + suffix + ' ../out/ ' + args . version , shell = True )
subprocess . check_call ( ' mv build/out/ wow nero-*.' + suffix + ' ../out/ ' + args . version , shell = True )
print ( ' Moving var/install.log to var/install- ' + tag_name + ' .log ' )
subprocess . check_call ( ' mv var/install.log var/install- ' + tag_name + ' .log ' , shell = True )
print ( ' Moving var/build.log to var/build- ' + tag_name + ' .log ' )
@ -93,7 +93,7 @@ def build():
os . chdir ( ' builder ' )
os . makedirs ( ' inputs ' , exist_ok = True )
subprocess . check_call ( [ ' make ' , ' -C ' , ' inputs/ mo nero/contrib/depends' , ' download ' , ' SOURCES_PATH= ' + os . getcwd ( ) + ' /cache/common ' ] )
subprocess . check_call ( [ ' make ' , ' -C ' , ' inputs/ wow nero/contrib/depends' , ' download ' , ' SOURCES_PATH= ' + os . getcwd ( ) + ' /cache/common ' ] )
rebuild ( )
@ -104,7 +104,7 @@ def verify():
for i , v in platforms :
print ( ' \n Verifying v ' + args . version + ' ' + v [ 0 ] + ' \n ' )
subprocess . check_call ( [ ' bin/gverify ' , ' -v ' , ' -d ' , ' ../sigs/ ' , ' -r ' , args . version + ' - ' + v [ 1 ] , ' inputs/ mo nero/contrib/gitian/gitian-' + v [ 1 ] + ' .yml ' ] )
subprocess . check_call ( [ ' bin/gverify ' , ' -v ' , ' -d ' , ' ../sigs/ ' , ' -r ' , args . version + ' - ' + v [ 1 ] , ' inputs/ wow nero/contrib/gitian/gitian-' + v [ 1 ] + ' .yml ' ] )
os . chdir ( workdir )
def main ( ) :
@ -113,7 +113,7 @@ def main():
parser = argparse . ArgumentParser ( description = ' Script for running full Gitian builds. ' , 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 ( ' -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://git hub.com/monero-project/mo nero' , help = ' Specify the URL of the repository. Default is %(default)s ' )
parser . add_argument ( ' -u ' , ' --url ' , dest = ' url ' , default = ' https://git .wownero.com/wownero/wow nero' , 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 ( ' -b ' , ' --build ' , action = ' store_true ' , dest = ' build ' , help = ' Do a Gitian build ' )
parser . add_argument ( ' -B ' , ' --buildsign ' , action = ' store_true ' , dest = ' buildsign ' , help = ' Build both signed and unsigned binaries ' )
@ -178,8 +178,8 @@ def main():
if args . setup :
setup ( )
os . makedirs ( ' builder/inputs/ mo nero' , exist_ok = True )
os . chdir ( ' builder/inputs/ mo nero' )
os . makedirs ( ' builder/inputs/ wow nero' , exist_ok = True )
os . chdir ( ' builder/inputs/ wow nero' )
if args . pull :
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 ( )