docker-stack 0.2.3__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {docker-stack-0.2.3 → docker-stack-0.2.4}/PKG-INFO +1 -1
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack/cli.py +9 -4
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack.egg-info/PKG-INFO +1 -1
- {docker-stack-0.2.3 → docker-stack-0.2.4}/setup.py +1 -1
- {docker-stack-0.2.3 → docker-stack-0.2.4}/README.md +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack/__init__.py +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack/compose.py +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack/docker_objects.py +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack/envsubst.py +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack/envsubst_merge.py +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack/helpers.py +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack/merge_conf.py +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack/registry.py +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack/url_parser.py +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack.egg-info/SOURCES.txt +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack.egg-info/dependency_links.txt +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack.egg-info/entry_points.txt +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack.egg-info/requires.txt +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/docker_stack.egg-info/top_level.txt +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/pyproject.toml +0 -0
- {docker-stack-0.2.3 → docker-stack-0.2.4}/setup.cfg +0 -0
|
@@ -61,11 +61,16 @@ class DockerStack:
|
|
|
61
61
|
with open(compose_file) as f:
|
|
62
62
|
return self.decode_yaml(f.read())
|
|
63
63
|
|
|
64
|
-
def rendered_compose_file(self,compose_file,stack=None)->str:
|
|
64
|
+
def rendered_compose_file(self,compose_file,stack=None,include_build=True)->str:
|
|
65
65
|
with open(compose_file) as f:
|
|
66
66
|
template_content = f.read()
|
|
67
67
|
# Parse the YAML content
|
|
68
68
|
compose_data = self.decode_yaml(template_content)
|
|
69
|
+
if not include_build:
|
|
70
|
+
services: dict=compose_data.get('services',{})
|
|
71
|
+
for (k,v) in services.items():
|
|
72
|
+
if 'build' in v:
|
|
73
|
+
del v['build']
|
|
69
74
|
if stack:
|
|
70
75
|
base_dir = os.path.dirname(os.path.abspath(compose_file))
|
|
71
76
|
if "configs" in compose_data:
|
|
@@ -77,13 +82,13 @@ class DockerStack:
|
|
|
77
82
|
def decode_yaml(self,data:str)->dict:
|
|
78
83
|
return yaml.safe_load(data)
|
|
79
84
|
|
|
80
|
-
def render_compose_file(self, compose_file,stack=None):
|
|
85
|
+
def render_compose_file(self, compose_file,stack=None,include_build=True):
|
|
81
86
|
"""
|
|
82
87
|
Render the Docker Compose file with environment variables and create Docker configs/secrets.
|
|
83
88
|
"""
|
|
84
89
|
|
|
85
90
|
# Convert the modified data back to YAML
|
|
86
|
-
rendered_content = self.rendered_compose_file(compose_file,stack)
|
|
91
|
+
rendered_content = self.rendered_compose_file(compose_file,stack,include_build=include_build)
|
|
87
92
|
|
|
88
93
|
# Write the rendered file
|
|
89
94
|
rendered_filename = Path(compose_file).with_name(
|
|
@@ -262,7 +267,7 @@ class DockerStack:
|
|
|
262
267
|
self.commands.append(Command(cmd,give_console=True))
|
|
263
268
|
|
|
264
269
|
def deploy(self, stack_name, compose_file, with_registry_auth=False,tag=None):
|
|
265
|
-
rendered_filename, rendered_content = self.render_compose_file(compose_file,stack=stack_name)
|
|
270
|
+
rendered_filename, rendered_content = self.render_compose_file(compose_file,stack=stack_name,include_build=False)
|
|
266
271
|
labels = [f"mesudip.stack.name={stack_name}"]
|
|
267
272
|
if tag:
|
|
268
273
|
labels.append(f"mesudip.stack.tag={tag}")
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="docker-stack",
|
|
5
|
-
version="0.2.
|
|
5
|
+
version="0.2.4",
|
|
6
6
|
description="CLI for deploying and managing Docker stacks.",
|
|
7
7
|
long_description=open("README.md").read(), # You can include a README file to describe your package
|
|
8
8
|
long_description_content_type="text/markdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|