docker-stack 0.2.2__tar.gz → 0.2.3__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.2 → docker-stack-0.2.3}/PKG-INFO +1 -1
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack/cli.py +8 -2
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack/envsubst.py +4 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack/helpers.py +4 -1
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack.egg-info/PKG-INFO +1 -1
- {docker-stack-0.2.2 → docker-stack-0.2.3}/setup.py +1 -1
- {docker-stack-0.2.2 → docker-stack-0.2.3}/README.md +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack/__init__.py +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack/compose.py +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack/docker_objects.py +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack/envsubst_merge.py +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack/merge_conf.py +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack/registry.py +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack/url_parser.py +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack.egg-info/SOURCES.txt +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack.egg-info/dependency_links.txt +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack.egg-info/entry_points.txt +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack.egg-info/requires.txt +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/docker_stack.egg-info/top_level.txt +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/pyproject.toml +0 -0
- {docker-stack-0.2.2 → docker-stack-0.2.3}/setup.cfg +0 -0
|
@@ -306,8 +306,14 @@ class DockerStack:
|
|
|
306
306
|
build_command = ["docker", "build", "-t", image]
|
|
307
307
|
|
|
308
308
|
|
|
309
|
-
|
|
310
|
-
|
|
309
|
+
args = build_config.get('args', [])
|
|
310
|
+
|
|
311
|
+
if isinstance(args, dict):
|
|
312
|
+
for key, val in args.items():
|
|
313
|
+
build_command.extend(["--build-arg", f"{envsubst(key)}={envsubst(val)}"])
|
|
314
|
+
elif isinstance(args, list):
|
|
315
|
+
for value in args:
|
|
316
|
+
build_command.extend(["--build-arg", envsubst(value)])
|
|
311
317
|
|
|
312
318
|
build_command.append(os.path.join(base_dir, build_config.get('context', '.')))
|
|
313
319
|
self.commands.append(Command(build_command))
|
|
@@ -25,6 +25,7 @@ def envsubst(template_str, env=os.environ):
|
|
|
25
25
|
# Regex for $VARIABLE without default
|
|
26
26
|
pattern_without_default = re.compile(r"\$([a-zA-Z_][a-zA-Z0-9_]*)")
|
|
27
27
|
|
|
28
|
+
template_str = template_str.replace("$$", "__ESCAPED_DOLLAR__")
|
|
28
29
|
def print_error_line(template_str, match_span):
|
|
29
30
|
"""Helper function to print the error context."""
|
|
30
31
|
lines = template_str.splitlines()
|
|
@@ -76,6 +77,8 @@ def envsubst(template_str, env=os.environ):
|
|
|
76
77
|
|
|
77
78
|
# Substitute variables without default values
|
|
78
79
|
template_str = pattern_without_default.sub(replace_without_default, template_str)
|
|
80
|
+
|
|
81
|
+
template_str = template_str.replace("__ESCAPED_DOLLAR__", "$")
|
|
79
82
|
|
|
80
83
|
return template_str
|
|
81
84
|
|
|
@@ -103,3 +106,4 @@ def main():
|
|
|
103
106
|
|
|
104
107
|
if __name__ == "__main__":
|
|
105
108
|
main()
|
|
109
|
+
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import subprocess
|
|
2
|
+
import sys
|
|
2
3
|
from typing import List, Optional
|
|
3
4
|
|
|
4
5
|
|
|
@@ -101,7 +102,9 @@ class Command:
|
|
|
101
102
|
# process.wait()
|
|
102
103
|
# return process
|
|
103
104
|
# else:
|
|
104
|
-
|
|
105
|
+
result= subprocess.run(self.command)
|
|
106
|
+
if result.returncode!= 0:
|
|
107
|
+
sys.exit(result.returncode)
|
|
105
108
|
else:
|
|
106
109
|
return run_cli_command(self.command, stdin=self.stdin, log=False, shell=False,cwd=self.cwd)
|
|
107
110
|
|
|
@@ -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.3",
|
|
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
|