def build_image(repo_path, repo_name): for dockerfile, image in yield_dockerfiles(repo_path, repo_name): try: run_cmd( ['docker', 'build', '-t', image, '-f', dockerfile, repo_path]) except subprocess.CalledProcessError: logging.error('Failed to build %s!' % dockerfile) sys.exit(1) time.sleep(1)
def build_image(repo_path, repo_name): for dockerfile, image in yield_dockerfiles(repo_path, repo_name): try: build_cmd = [ 'docker', 'build', '-t', image, '-f', dockerfile, repo_path ] if os.environ.get('PULL_BASEIMAGES', '0') == '1': build_cmd.append('--pull') run_cmd(build_cmd) except subprocess.CalledProcessError: logging.error('Failed to build %s!' % dockerfile) sys.exit(1) time.sleep(1)
def sanity_check(): # Check if the challenge is static is_static = len(list(yield_dockerfiles(repo_path, repo_name))) == 0 if is_static and len(glob('downloads/*')) == 0: logging.warning( 'Static challenges should have a "downloads" directory for sharing challenge files with users.' ) check_yml('config.yml', is_static) if not is_static: check_controller() check_dockerfile('solvable/Dockerfile') check_metadata() check_misc()