@@ -8,8 +8,7 @@ steps: | |||||
- mkdir -p /cookiecutter/input/nginx-https | - mkdir -p /cookiecutter/input/nginx-https | ||||
- mkdir -p /cookiecutter/templates/nginx-http/\{\{cookiecutter.directory_name\}\} | - mkdir -p /cookiecutter/templates/nginx-http/\{\{cookiecutter.directory_name\}\} | ||||
- mkdir -p /cookiecutter/templates/nginx-https/\{\{cookiecutter.directory_name\}\} | - mkdir -p /cookiecutter/templates/nginx-https/\{\{cookiecutter.directory_name\}\} | ||||
- mkdir -p /cookiecutter/output/nginx-http | |||||
- mkdir -p /cookiecutter/output/nginx-https | |||||
- mkdir -p /cookiecutter/output | |||||
- mkdir -p /cookiecutter/scripts | - mkdir -p /cookiecutter/scripts | ||||
- copy: | - copy: | ||||
- [ files/run.sh, | - [ files/run.sh, | ||||
@@ -1,17 +1,21 @@ | |||||
#!/bin/sh | #!/bin/sh | ||||
mkdir -p /cookiecutter/output/meta && \ | |||||
cp -v /cookiecutter/input/meta/cookiecutter.json \ | |||||
/cookiecutter/output/meta/cookiecutter.json && \ | |||||
\ | |||||
cp -v /cookiecutter/input/nginx-http/nginx.conf \ | cp -v /cookiecutter/input/nginx-http/nginx.conf \ | ||||
/cookiecutter/templates/nginx-http/\{\{cookiecutter.directory_name\}\}/nginx.conf | |||||
/cookiecutter/templates/nginx-http/\{\{cookiecutter.directory_name\}\}/nginx.conf && \ | |||||
cp -v /cookiecutter/input/meta/cookiecutter.json \ | cp -v /cookiecutter/input/meta/cookiecutter.json \ | ||||
/cookiecutter/templates/nginx-http/cookiecutter.json | |||||
/cookiecutter/templates/nginx-http/cookiecutter.json && \ | |||||
\ | |||||
cp -v /cookiecutter/input/nginx-https/nginx.conf \ | cp -v /cookiecutter/input/nginx-https/nginx.conf \ | ||||
/cookiecutter/templates/nginx-https/\{\{cookiecutter.directory_name\}\}/nginx.conf | |||||
/cookiecutter/templates/nginx-https/\{\{cookiecutter.directory_name\}\}/nginx.conf && \ | |||||
cp -v /cookiecutter/input/meta/cookiecutter.json \ | cp -v /cookiecutter/input/meta/cookiecutter.json \ | ||||
/cookiecutter/templates/nginx-https/cookiecutter.json | |||||
cd /cookiecutter/output | |||||
cookiecutter --no-input /cookiecutter/templates/nginx-http directory_name=nginx-http | |||||
cd /cookiecutter/output | |||||
/cookiecutter/templates/nginx-https/cookiecutter.json && \ | |||||
\ | |||||
cd /cookiecutter/output && \ | |||||
cookiecutter --no-input /cookiecutter/templates/nginx-http directory_name=nginx-http && \ | |||||
\ | |||||
cd /cookiecutter/output && \ | |||||
cookiecutter --no-input /cookiecutter/templates/nginx-https directory_name=nginx-https | cookiecutter --no-input /cookiecutter/templates/nginx-https directory_name=nginx-https |
@@ -99,6 +99,7 @@ def create_parser(): | |||||
parser = ListForwarder([subparsers.add_parser(cmd) for cmd in ['list', 'ls', 'l']]) | parser = ListForwarder([subparsers.add_parser(cmd) for cmd in ['list', 'ls', 'l']]) | ||||
parser.set_defaults(func=command_image_list) | parser.set_defaults(func=command_image_list) | ||||
parser.add_argument('--full-sha256', '-f', action='store_true') | parser.add_argument('--full-sha256', '-f', action='store_true') | ||||
parser.add_argument('--tagged-only', '-t', action='store_true') | |||||
parser = ListForwarder([subparsers.add_parser(cmd) for cmd in ['prune', 'pru', 'p']]) | parser = ListForwarder([subparsers.add_parser(cmd) for cmd in ['prune', 'pru', 'p']]) | ||||
parser.set_defaults(func=command_image_prune) | parser.set_defaults(func=command_image_prune) | ||||
@@ -127,7 +127,10 @@ def command_image_list(args): | |||||
lst = zfs_list(fields=['name', 'refer', 'focker:sha256', 'focker:tags', 'origin'], | lst = zfs_list(fields=['name', 'refer', 'focker:sha256', 'focker:tags', 'origin'], | ||||
focker_type='image') | focker_type='image') | ||||
# zfs_parse_output(['zfs', 'list', '-o', 'name,refer,focker:sha256,focker:tags,origin', '-H']) | # zfs_parse_output(['zfs', 'list', '-o', 'name,refer,focker:sha256,focker:tags,origin', '-H']) | ||||
lst = list(filter(lambda a: a[2] != '-', lst)) | |||||
lst = filter(lambda a: a[2] != '-', lst) | |||||
if args.tagged_only: | |||||
lst = filter(lambda a: a[3] != '-', lst) | |||||
lst = list(lst) | |||||
lst = list(map(lambda a: [ a[3], a[1], | lst = list(map(lambda a: [ a[3], a[1], | ||||
a[2] if args.full_sha256 else a[2][:7], | a[2] if args.full_sha256 else a[2][:7], | ||||
a[4].split('/')[-1].split('@')[0] ], lst)) | a[4].split('/')[-1].split('@')[0] ], lst)) | ||||