2013-07-18 13:22:07 -04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import argparse
|
2013-08-09 10:40:28 -04:00
|
|
|
import sys
|
2013-07-18 13:22:07 -04:00
|
|
|
|
2013-08-09 10:40:28 -04:00
|
|
|
try:
|
|
|
|
import brew
|
|
|
|
except ImportError as e:
|
|
|
|
print str(e)
|
|
|
|
print 'Please install the required dependencies first'
|
|
|
|
print 'sudo pip install -r requirements.txt'
|
|
|
|
sys.exit(1)
|
2013-07-18 13:22:07 -04:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
parser = argparse.ArgumentParser('Build the docker standard library')
|
|
|
|
parser.add_argument('--push', action='store_true', default=False,
|
2013-08-06 15:08:27 -04:00
|
|
|
help='Push generated repositories')
|
2013-07-24 10:47:50 -04:00
|
|
|
parser.add_argument('--debug', default=False, action='store_true',
|
|
|
|
help='Enable debugging output')
|
2013-07-24 17:47:44 -04:00
|
|
|
parser.add_argument('--noprefill', default=True, action='store_false',
|
|
|
|
dest='prefill', help='Disable cache prefill')
|
2013-07-18 13:22:07 -04:00
|
|
|
parser.add_argument('-n', metavar='NAMESPACE', default='library',
|
2013-08-06 15:08:27 -04:00
|
|
|
help='Namespace used for generated repositories.'
|
2013-07-18 13:22:07 -04:00
|
|
|
' Default is library')
|
2013-07-24 10:47:50 -04:00
|
|
|
parser.add_argument('-b', metavar='BRANCH', default=brew.DEFAULT_BRANCH,
|
2013-08-06 15:08:27 -04:00
|
|
|
help='Branch in the repository where the library definition'
|
2013-07-24 10:47:50 -04:00
|
|
|
' files will be fetched. Default is ' + brew.DEFAULT_BRANCH)
|
|
|
|
parser.add_argument('repository', default=brew.DEFAULT_REPOSITORY,
|
|
|
|
nargs='?', help='git repository containing the library definition'
|
|
|
|
' files. Default is ' + brew.DEFAULT_REPOSITORY)
|
2013-08-06 15:08:27 -04:00
|
|
|
parser.add_argument('--reg', default=None, help='Registry address to'
|
|
|
|
' push build results to. Also sets push to true.')
|
2013-07-18 13:22:07 -04:00
|
|
|
args = parser.parse_args()
|
2013-08-06 15:08:27 -04:00
|
|
|
brew.build_library(args.repository, args.b, args.n,
|
|
|
|
args.push or args.reg is not None, args.debug, args.prefill, args.reg)
|