Skip to content

Commit 1bf3f57

Browse files
committed
Add option to disregard the owner from the Docker tag for the purpose of
pushing repositories into Dockerhub.
1 parent 558ad8c commit 1bf3f57

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

unity_app_generator/__main__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def init(args):
5454
def build_docker(args):
5555
state_dir = check_state_directory(state_directory_path(args))
5656

57-
app_gen = UnityApplicationGenerator(state_dir)
57+
app_gen = UnityApplicationGenerator(state_dir, use_owner=args.use_owner)
5858

5959
app_gen.create_docker_image()
6060

@@ -116,6 +116,9 @@ def main():
116116
parser_build_docker = subparsers.add_parser('build_docker',
117117
help=f"Build a Docker image from the initialized application directory")
118118

119+
parser_build_docker.add_argument("--no_owner", dest="use_owner", action="store_false", default=True,
120+
help="Disable using the owner of the Git repository in the Docker image tag")
121+
119122
parser_build_docker.set_defaults(func=build_docker)
120123

121124
# push_docker

unity_app_generator/generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ApplicationGenerationError(Exception):
1717

1818
class UnityApplicationGenerator(object):
1919

20-
def __init__(self, state_directory, source_repository=None, destination_directory=None, checkout=None):
20+
def __init__(self, state_directory, source_repository=None, destination_directory=None, checkout=None, use_owner=True):
2121

2222
if not ApplicationState.exists(state_directory):
2323
self.repo_info = self._localize_source(source_repository, destination_directory, checkout)
@@ -26,7 +26,7 @@ def __init__(self, state_directory, source_repository=None, destination_director
2626
self.app_state = ApplicationState(state_directory)
2727
self.repo_info = self._localize_source(self.app_state.source_repository, self.app_state.app_base_path, checkout)
2828

29-
self.docker_util = DockerUtil(self.repo_info, do_prune=False)
29+
self.docker_util = DockerUtil(self.repo_info, do_prune=False, use_owner=use_owner)
3030

3131
def _localize_source(self, source, dest, checkout):
3232

0 commit comments

Comments
 (0)