create-workspace: disable --squash by default

This commit is contained in:
Oleksii Shevchuk 2020-03-29 19:01:01 +03:00
parent 9ec5611eba
commit 14f8238981
1 changed files with 15 additions and 5 deletions

View File

@ -75,6 +75,11 @@ parser.add_argument(
help='Do not remove docker/podman build image' help='Do not remove docker/podman build image'
) )
parser.add_argument(
'-S', '--squash', default=False, action='store_true',
help='Use --squash feature (podman/docker)'
)
parser.add_argument( parser.add_argument(
'-R', '--images-repo', default='alxchk', '-R', '--images-repo', default='alxchk',
help='Use non-default toolchains repo (Use "local" to ' help='Use non-default toolchains repo (Use "local" to '
@ -425,17 +430,22 @@ def create_virtualenv(workdir, git_path, orchestrator=None, templates=[]):
def create_container_env( def create_container_env(
workdir, git_path, orchestrator, network, templates=[]): workdir, git_path, orchestrator, network, templates=[], squash=False):
print("[+] Build {} image ({})".format(orchestrator, ENV_IMAGE)) print("[+] Build {} image ({})".format(orchestrator, ENV_IMAGE))
build_command = [ build_command = [
orchestrator, 'build', orchestrator, 'build'
'--squash', ]
if squash:
build_command.append('--squash')
build_command.extend([
'-t', ENV_IMAGE, '-t', ENV_IMAGE,
'-f', 'conf/Dockerfile.env', '-f', 'conf/Dockerfile.env',
os.path.join(git_path, 'pupy') os.path.join(git_path, 'pupy')
] ])
try: try:
with open(os.devnull, 'w') as devnull: with open(os.devnull, 'w') as devnull:
@ -614,7 +624,7 @@ def main():
if args.environment in ('podman', 'docker'): if args.environment in ('podman', 'docker'):
shell_cmds, update_cmds = create_container_env( shell_cmds, update_cmds = create_container_env(
workdir, git_folder, default_orchestrator, workdir, git_folder, default_orchestrator,
args.network, templates args.network, templates, args.squash
) )
update_commands.extend(update_cmds) update_commands.extend(update_cmds)