Output Dockerfile contents if set to --debug

The Dockerfile we generate won't really work at all outside
of repo2docker. This makes it very clear that these are purely
for debugging purposes.
pull/68/head
yuvipanda 2017-08-27 11:04:01 -04:00
rodzic 3b226d183b
commit d116c30498
1 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -145,8 +145,8 @@ class Repo2Docker(Application):
) )
argparser.add_argument( argparser.add_argument(
'--print-dockerfile', '--debug',
help="Print dockerfile contents to stdout", help="Turn on debug logging",
action='store_true', action='store_true',
) )
@ -182,6 +182,9 @@ class Repo2Docker(Application):
def initialize(self): def initialize(self):
args = self.get_argparser().parse_args() args = self.get_argparser().parse_args()
if args.debug:
self.log_level = logging.DEBUG
self.load_config_file(args.config) self.load_config_file(args.config)
if os.path.exists(args.repo): if os.path.exists(args.repo):
@ -223,7 +226,6 @@ class Repo2Docker(Application):
self.run = args.run self.run = args.run
self.json_logs = args.json_logs self.json_logs = args.json_logs
self.print_dockerfile = args.print_dockerfile
self.build = args.build self.build = args.build
if not self.build: if not self.build:
# Can't push nor run if we aren't building # Can't push nor run if we aren't building
@ -316,8 +318,7 @@ class Repo2Docker(Application):
picked_buildpack = bp picked_buildpack = bp
break break
if self.print_dockerfile: self.log.debug(picked_buildpack.render(), extra=dict(phase='building'))
self.log.info(picked_buildpack.render(), extra=dict(phase='building'))
if self.build: if self.build:
self.log.info('Using %s builder\n', bp.name, extra=dict(phase='building')) self.log.info('Using %s builder\n', bp.name, extra=dict(phase='building'))