Images builder which takes the dockerfiles (both raw and jinja2 templated), generated the dependency tree between them and the builds them in appropriate sequence. Change-Id: Iedcb32c91d2d779d8dcc6cc4b777da932086dcbd
37 lines
778 B
Python
37 lines
778 B
Python
import sys
|
|
|
|
from oslo_config import cfg
|
|
from oslo_log import log as logging
|
|
|
|
from microservices import build
|
|
from microservices import fetch
|
|
|
|
|
|
CONF = cfg.CONF
|
|
CONF.import_group('repositories', 'microservices.config.repositories')
|
|
CONF.import_opt('action', 'microservices.config.cli')
|
|
|
|
|
|
def do_build():
|
|
components = CONF.action.components
|
|
if CONF.repositories.clone:
|
|
fetch.fetch_repositories(components=components)
|
|
build.build_repositories(components=components)
|
|
|
|
|
|
def do_fetch():
|
|
fetch.fetch_repositories(components=CONF.action.components)
|
|
|
|
|
|
def main():
|
|
logging.register_options(CONF)
|
|
logging.setup(CONF, 'microservices')
|
|
CONF(sys.argv[1:])
|
|
|
|
func = globals()['do_%s' % CONF.action.name]
|
|
func()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|