sync confirmed working. still need to test iPXE builds.
This commit is contained in:
parent
60ee17bf9d
commit
3c46d85683
@ -386,7 +386,7 @@ def genISO(conf):
|
||||
|
||||
def displayStats(iso):
|
||||
for i in iso['name']:
|
||||
print("{0}:\t\t\t == {1} {2} ==".format(datetime.datetime.now(), iso[i]['type'], iso[i]['fmt']))
|
||||
print("{0}: == {1} {2} ==".format(datetime.datetime.now(), iso[i]['type'], iso[i]['fmt']))
|
||||
print('\t\t\t = Size: {0}'.format(iso[i]['size']))
|
||||
print('\t\t\t = SHA256: {0}'.format(iso[i]['sha']))
|
||||
print('\t\t\t = Location: {0}'.format(iso[i]['file']))
|
||||
|
@ -2,6 +2,7 @@ import os
|
||||
import sys
|
||||
import platform
|
||||
import re
|
||||
import glob
|
||||
import configparser
|
||||
import validators
|
||||
import git
|
||||
@ -75,6 +76,22 @@ def parseConfig(confs):
|
||||
config_dict['bdisk']['ver'] = refs[0] + 'r' + refs[2]
|
||||
for i in ('http', 'tftp', 'rsync', 'git'):
|
||||
config_dict['sync'][i] = config['sync'].getboolean(i)
|
||||
# And the build number.
|
||||
# TODO: support tracking builds per version. i.e. in buildnum:
|
||||
# v2.51r13:0
|
||||
# v2.51r17:3
|
||||
if os.path.isfile(config_dict['build']['dlpath'] + '/buildnum'):
|
||||
with open(config_dict['build']['dlpath'] + '/buildnum', 'r') as f:
|
||||
config_dict['build']['buildnum'] = int(f.readlines()[0])
|
||||
else:
|
||||
config_dict['build']['buildnum'] = 0
|
||||
# But logically we should start the build over at 0 if we don't have any existing ISO's.
|
||||
if os.path.isdir(config_dict['build']['isodir']):
|
||||
if os.listdir(config_dict['build']['isodir']) == []:
|
||||
conf_dict['build']['buildnum'] = 0
|
||||
# ...or if we don't have any previous builds for this ISO version.
|
||||
elif not glob.glob('{0}/*v{1}r*.iso'.format(config_dict['build']['isodir'], config_dict['build']['ver'])):
|
||||
config_dict['build']['buildnum'] = 0
|
||||
config_dict['ipxe']['iso'] = config['ipxe'].getboolean('iso')
|
||||
config_dict['ipxe']['usb'] = config['ipxe'].getboolean('usb')
|
||||
# and build a list of arch(es) we want to build
|
||||
|
@ -110,8 +110,7 @@ def buildIPXE(conf):
|
||||
DEVNULL = open(os.devnull, 'w')
|
||||
if os.path.isfile(build['dlpath'] + '/ipxe.log'):
|
||||
os.remove(build['dlpath'] + '/ipxe.log')
|
||||
print(('{0}: [IPXE] Building iPXE ({1})...\n\t\t\t PROGRESS: ' +
|
||||
'tail -f {2}/ipxe.log').format(
|
||||
print(('{0}: [IPXE] Building iPXE ({1})... PROGRESS: tail -f {2}/ipxe.log ...').format(
|
||||
datetime.datetime.now(),
|
||||
ipxe_src,
|
||||
build['dlpath']))
|
||||
|
@ -191,15 +191,6 @@ def prepChroot(build, bdisk, user):
|
||||
build['user'] = os.environ['USER']
|
||||
if 'SUDO_USER' in os.environ:
|
||||
build['realuser'] = os.environ['SUDO_USER']
|
||||
# Get the build number...
|
||||
# TODO: support tracking builds per version. i.e. in buildnum:
|
||||
# v2.51-g7381cc3:0
|
||||
# v2.51-gb3bb039:3
|
||||
if os.path.isfile(dlpath + '/buildnum'):
|
||||
with open(dlpath + '/buildnum', 'r') as f:
|
||||
build['buildnum'] = int(f.readlines()[0])
|
||||
else:
|
||||
build['buildnum'] = 0
|
||||
build['buildnum'] += 1
|
||||
with open(dlpath + '/buildnum', 'w+') as f:
|
||||
f.write(str(build['buildnum']) + "\n")
|
||||
|
Loading…
Reference in New Issue
Block a user