docker-stack 0.2.6__tar.gz → 0.3.1__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.
Files changed (28) hide show
  1. docker_stack-0.3.1/PKG-INFO +118 -0
  2. docker_stack-0.3.1/README.md +95 -0
  3. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack/__init__.py +0 -1
  4. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack/cli.py +156 -96
  5. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack/compose.py +1 -0
  6. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack/docker_objects.py +91 -35
  7. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack/envsubst.py +49 -51
  8. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack/envsubst_merge.py +6 -10
  9. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack/helpers.py +60 -24
  10. docker_stack-0.3.1/docker_stack/markers.py +83 -0
  11. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack/merge_conf.py +3 -9
  12. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack/registry.py +77 -77
  13. docker_stack-0.3.1/docker_stack/url_parser.py +177 -0
  14. docker_stack-0.3.1/docker_stack.egg-info/PKG-INFO +118 -0
  15. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack.egg-info/SOURCES.txt +4 -1
  16. {docker-stack-0.2.6 → docker_stack-0.3.1}/setup.py +2 -4
  17. docker_stack-0.3.1/tests/test_docker_objects.py +46 -0
  18. docker_stack-0.3.1/tests/test_docker_stack.py +7 -0
  19. docker-stack-0.2.6/PKG-INFO +0 -19
  20. docker-stack-0.2.6/README.md +0 -6
  21. docker-stack-0.2.6/docker_stack/url_parser.py +0 -171
  22. docker-stack-0.2.6/docker_stack.egg-info/PKG-INFO +0 -19
  23. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack.egg-info/dependency_links.txt +0 -0
  24. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack.egg-info/entry_points.txt +0 -0
  25. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack.egg-info/requires.txt +0 -0
  26. {docker-stack-0.2.6 → docker_stack-0.3.1}/docker_stack.egg-info/top_level.txt +0 -0
  27. {docker-stack-0.2.6 → docker_stack-0.3.1}/pyproject.toml +0 -0
  28. {docker-stack-0.2.6 → docker_stack-0.3.1}/setup.cfg +0 -0
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.4
2
+ Name: docker-stack
3
+ Version: 0.3.1
4
+ Summary: CLI for deploying and managing Docker stacks.
5
+ Home-page: https://github.com/mesudip/docker-stack
6
+ Author: Sudip Bhattarai
7
+ Author-email: sudip@bhattarai.me
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: PyYAML
14
+ Dynamic: author
15
+ Dynamic: author-email
16
+ Dynamic: classifier
17
+ Dynamic: description
18
+ Dynamic: description-content-type
19
+ Dynamic: home-page
20
+ Dynamic: requires-dist
21
+ Dynamic: requires-python
22
+ Dynamic: summary
23
+
24
+ # Docker Stack CLI Utility
25
+
26
+ A powerful command-line utility designed to enhance Docker Swarm stack deployments by providing advanced features for managing Docker configs and secrets. This tool aims to simplify complex deployment scenarios and offer capabilities beyond vanilla Docker Stack.
27
+
28
+ ## Features
29
+
30
+ - **Docker Config and Secret Management with Extended Options:**
31
+ This utility significantly extends Docker's native config and secret management by introducing `x-` prefixed directives in your `docker-compose.yml` files. These directives allow for dynamic content generation, templating, and file inclusion, making your deployments more flexible and secure.
32
+
33
+ ### `x-content`: Inline Content for Configs and Secrets
34
+ Allows you to define the content of a Docker config or secret directly within your `docker-compose.yml`.
35
+
36
+ ```yaml
37
+ secrets:
38
+ my_inline_secret:
39
+ x-content: "This is my secret content defined inline."
40
+
41
+ configs:
42
+ my_inline_config:
43
+ x-content: |
44
+ key=value
45
+ another_key=another_value
46
+ ```
47
+
48
+ ### `x-template`: Environment Variable Templating
49
+ Enables the use of environment variables within your config or secret content, which are substituted at deployment time.
50
+
51
+ ```yaml
52
+ secrets:
53
+ my_templated_secret:
54
+ x-template: "I can create composite secret with template. ${API_KEY_NAME}:${MY_API_KEY}"
55
+ ```
56
+
57
+ ### `x-template-file`: External Template Files
58
+ Reference an external file whose content will be treated as a template and processed with environment variables.
59
+
60
+ ```yaml
61
+ configs:
62
+ my_config_from_template_file:
63
+ x-template-file: "./templates/my_config.tpl"
64
+ ```
65
+ *(Content of `./templates/my_config.tpl` might be: `DB_HOST=${DATABASE_HOST}`)*
66
+
67
+ ### `x-generate`: Dynamic Secret Generation (Secrets Only)
68
+ This powerful feature allows you to automatically generate random secrets based on specified criteria, eliminating the need to manually create and manage them. This is particularly useful for passwords, API keys, and other sensitive data.
69
+
70
+ - **Simple Generation (12-20 characters, default options):**
71
+ ```yaml
72
+ secrets:
73
+ my_simple_generated_secret:
74
+ x-generate: true
75
+ ```
76
+
77
+ - **Specify Length:**
78
+ ```yaml
79
+ secrets:
80
+ my_fixed_length_secret:
81
+ x-generate: 30 # Generates a 30-character secret
82
+ ```
83
+
84
+ - **Custom Generation Options:**
85
+ You can provide a dictionary to fine-tune the generation process:
86
+ - `length`: (integer, default: 12-20 random) Exact length of the secret.
87
+ - `numbers`: (boolean, default: `true`) Include numbers (0-9).
88
+ - `special`: (boolean, default: `true`) Include special characters (!@#$%^&*...).
89
+ - `uppercase`: (boolean, default: `true`) Include uppercase letters (A-Z).
90
+
91
+ ```yaml
92
+ secrets:
93
+ my_complex_generated_secret:
94
+ x-generate:
95
+ length: 25
96
+ numbers: false
97
+ special: true
98
+ uppercase: true
99
+ my_alphanumeric_secret:
100
+ x-generate:
101
+ length: 15
102
+ numbers: true
103
+ special: false
104
+ uppercase: false
105
+ ```
106
+
107
+ - **Docker Stack Versioning and Config Backup for Rollback:**
108
+ The utility automatically versions your Docker configs and secrets, allowing for easy tracking of changes and seamless rollbacks to previous states. This provides a safety net for your deployments, ensuring you can always revert to a stable configuration.
109
+
110
+ ## Why use Docker Stack CLI Utility?
111
+
112
+ Vanilla Docker Stack deployments can sometimes lack the flexibility needed for dynamic environments or robust secret management. This utility bridges those gaps by:
113
+ - **Automating Secret Management:** No more manual secret generation or complex external scripts.
114
+ - **Simplifying Configuration:** Define configs and secrets directly in your compose files or use templates.
115
+ - **Enhancing Security:** Generate strong, random secrets on the fly.
116
+ - **Enabling Rollbacks:** Versioning ensures you can always revert to a known good state.
117
+
118
+ Get started today and streamline your Docker Swarm deployments!
@@ -0,0 +1,95 @@
1
+ # Docker Stack CLI Utility
2
+
3
+ A powerful command-line utility designed to enhance Docker Swarm stack deployments by providing advanced features for managing Docker configs and secrets. This tool aims to simplify complex deployment scenarios and offer capabilities beyond vanilla Docker Stack.
4
+
5
+ ## Features
6
+
7
+ - **Docker Config and Secret Management with Extended Options:**
8
+ This utility significantly extends Docker's native config and secret management by introducing `x-` prefixed directives in your `docker-compose.yml` files. These directives allow for dynamic content generation, templating, and file inclusion, making your deployments more flexible and secure.
9
+
10
+ ### `x-content`: Inline Content for Configs and Secrets
11
+ Allows you to define the content of a Docker config or secret directly within your `docker-compose.yml`.
12
+
13
+ ```yaml
14
+ secrets:
15
+ my_inline_secret:
16
+ x-content: "This is my secret content defined inline."
17
+
18
+ configs:
19
+ my_inline_config:
20
+ x-content: |
21
+ key=value
22
+ another_key=another_value
23
+ ```
24
+
25
+ ### `x-template`: Environment Variable Templating
26
+ Enables the use of environment variables within your config or secret content, which are substituted at deployment time.
27
+
28
+ ```yaml
29
+ secrets:
30
+ my_templated_secret:
31
+ x-template: "I can create composite secret with template. ${API_KEY_NAME}:${MY_API_KEY}"
32
+ ```
33
+
34
+ ### `x-template-file`: External Template Files
35
+ Reference an external file whose content will be treated as a template and processed with environment variables.
36
+
37
+ ```yaml
38
+ configs:
39
+ my_config_from_template_file:
40
+ x-template-file: "./templates/my_config.tpl"
41
+ ```
42
+ *(Content of `./templates/my_config.tpl` might be: `DB_HOST=${DATABASE_HOST}`)*
43
+
44
+ ### `x-generate`: Dynamic Secret Generation (Secrets Only)
45
+ This powerful feature allows you to automatically generate random secrets based on specified criteria, eliminating the need to manually create and manage them. This is particularly useful for passwords, API keys, and other sensitive data.
46
+
47
+ - **Simple Generation (12-20 characters, default options):**
48
+ ```yaml
49
+ secrets:
50
+ my_simple_generated_secret:
51
+ x-generate: true
52
+ ```
53
+
54
+ - **Specify Length:**
55
+ ```yaml
56
+ secrets:
57
+ my_fixed_length_secret:
58
+ x-generate: 30 # Generates a 30-character secret
59
+ ```
60
+
61
+ - **Custom Generation Options:**
62
+ You can provide a dictionary to fine-tune the generation process:
63
+ - `length`: (integer, default: 12-20 random) Exact length of the secret.
64
+ - `numbers`: (boolean, default: `true`) Include numbers (0-9).
65
+ - `special`: (boolean, default: `true`) Include special characters (!@#$%^&*...).
66
+ - `uppercase`: (boolean, default: `true`) Include uppercase letters (A-Z).
67
+
68
+ ```yaml
69
+ secrets:
70
+ my_complex_generated_secret:
71
+ x-generate:
72
+ length: 25
73
+ numbers: false
74
+ special: true
75
+ uppercase: true
76
+ my_alphanumeric_secret:
77
+ x-generate:
78
+ length: 15
79
+ numbers: true
80
+ special: false
81
+ uppercase: false
82
+ ```
83
+
84
+ - **Docker Stack Versioning and Config Backup for Rollback:**
85
+ The utility automatically versions your Docker configs and secrets, allowing for easy tracking of changes and seamless rollbacks to previous states. This provides a safety net for your deployments, ensuring you can always revert to a stable configuration.
86
+
87
+ ## Why use Docker Stack CLI Utility?
88
+
89
+ Vanilla Docker Stack deployments can sometimes lack the flexibility needed for dynamic environments or robust secret management. This utility bridges those gaps by:
90
+ - **Automating Secret Management:** No more manual secret generation or complex external scripts.
91
+ - **Simplifying Configuration:** Define configs and secrets directly in your compose files or use templates.
92
+ - **Enhancing Security:** Generate strong, random secrets on the fly.
93
+ - **Enabling Rollbacks:** Versioning ensures you can always revert to a known good state.
94
+
95
+ Get started today and streamline your Docker Swarm deployments!
@@ -1,4 +1,3 @@
1
-
2
1
  from .envsubst import envsubst, envsubst_load_file
3
2
  from .compose import read_compose_file
4
3
  from .docker_objects import DockerConfig, DockerSecret