adeploy 1.0.0__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.
- adeploy-1.0.0/.gitignore +107 -0
- adeploy-1.0.0/.gitlab-ci.yml +95 -0
- adeploy-1.0.0/DEVELOP.md +88 -0
- adeploy-1.0.0/LICENSE +29 -0
- adeploy-1.0.0/PKG-INFO +94 -0
- adeploy-1.0.0/README.md +69 -0
- adeploy-1.0.0/adeploy/__init__.py +0 -0
- adeploy-1.0.0/adeploy/common/__init__.py +0 -0
- adeploy-1.0.0/adeploy/common/args.py +112 -0
- adeploy-1.0.0/adeploy/common/colors.py +49 -0
- adeploy-1.0.0/adeploy/common/deployment.py +99 -0
- adeploy-1.0.0/adeploy/common/errors.py +32 -0
- adeploy-1.0.0/adeploy/common/gopass.py +107 -0
- adeploy-1.0.0/adeploy/common/helpers.py +78 -0
- adeploy-1.0.0/adeploy/common/jinja/__init__.py +0 -0
- adeploy-1.0.0/adeploy/common/jinja/dict.py +44 -0
- adeploy-1.0.0/adeploy/common/jinja/env.py +59 -0
- adeploy-1.0.0/adeploy/common/jinja/filters.py +114 -0
- adeploy-1.0.0/adeploy/common/jinja/globals.py +482 -0
- adeploy-1.0.0/adeploy/common/kubectl.py +202 -0
- adeploy-1.0.0/adeploy/common/logging.py +35 -0
- adeploy-1.0.0/adeploy/common/provider.py +169 -0
- adeploy-1.0.0/adeploy/common/secret.py +387 -0
- adeploy-1.0.0/adeploy/common/version.py +38 -0
- adeploy-1.0.0/adeploy/common/yaml/__init__.py +3 -0
- adeploy-1.0.0/adeploy/common/yaml/find.py +19 -0
- adeploy-1.0.0/adeploy/common/yaml/labels.py +49 -0
- adeploy-1.0.0/adeploy/common/yaml/probes.py +47 -0
- adeploy-1.0.0/adeploy/common/yaml/resources.py +35 -0
- adeploy-1.0.0/adeploy/common/yaml/update.py +49 -0
- adeploy-1.0.0/adeploy/main.py +74 -0
- adeploy-1.0.0/adeploy/providers/__init__.py +0 -0
- adeploy-1.0.0/adeploy/providers/helm/README.md +55 -0
- adeploy-1.0.0/adeploy/providers/helm/__init__.py +4 -0
- adeploy-1.0.0/adeploy/providers/helm/common/__init__.py +3 -0
- adeploy-1.0.0/adeploy/providers/helm/common/helm.py +93 -0
- adeploy-1.0.0/adeploy/providers/helm/common/helm_output.py +26 -0
- adeploy-1.0.0/adeploy/providers/helm/common/helm_provider.py +13 -0
- adeploy-1.0.0/adeploy/providers/helm/deployer.py +53 -0
- adeploy-1.0.0/adeploy/providers/helm/renderer.py +177 -0
- adeploy-1.0.0/adeploy/providers/helm/tester.py +150 -0
- adeploy-1.0.0/adeploy/providers/helm/watcher.py +21 -0
- adeploy-1.0.0/adeploy/providers/jinja/README.md +372 -0
- adeploy-1.0.0/adeploy/providers/jinja/__init__.py +4 -0
- adeploy-1.0.0/adeploy/providers/jinja/deployer.py +55 -0
- adeploy-1.0.0/adeploy/providers/jinja/renderer.py +114 -0
- adeploy-1.0.0/adeploy/providers/jinja/tester.py +61 -0
- adeploy-1.0.0/adeploy/providers/jinja/watcher.py +173 -0
- adeploy-1.0.0/adeploy/steps/__init__.py +5 -0
- adeploy-1.0.0/adeploy/steps/config.py +62 -0
- adeploy-1.0.0/adeploy/steps/deploy.py +81 -0
- adeploy-1.0.0/adeploy/steps/render.py +73 -0
- adeploy-1.0.0/adeploy/steps/test.py +81 -0
- adeploy-1.0.0/adeploy/steps/watch.py +74 -0
- adeploy-1.0.0/adeploy.egg-info/PKG-INFO +94 -0
- adeploy-1.0.0/adeploy.egg-info/SOURCES.txt +228 -0
- adeploy-1.0.0/adeploy.egg-info/dependency_links.txt +1 -0
- adeploy-1.0.0/adeploy.egg-info/entry_points.txt +2 -0
- adeploy-1.0.0/adeploy.egg-info/requires.txt +8 -0
- adeploy-1.0.0/adeploy.egg-info/top_level.txt +1 -0
- adeploy-1.0.0/docs/assets/css/asciinema-player.css +2117 -0
- adeploy-1.0.0/docs/assets/css/badges.css +19 -0
- adeploy-1.0.0/docs/assets/css/docstrings.css +7 -0
- adeploy-1.0.0/docs/assets/css/footer.css +15 -0
- adeploy-1.0.0/docs/assets/download.sh +4 -0
- adeploy-1.0.0/docs/assets/img/awesome-logo.png +0 -0
- adeploy-1.0.0/docs/assets/js/asciinema-init.js +6 -0
- adeploy-1.0.0/docs/assets/js/asciinema-player.min.js +1 -0
- adeploy-1.0.0/docs/common/_more.md +3 -0
- adeploy-1.0.0/docs/common/filters.md +9 -0
- adeploy-1.0.0/docs/common/functions.md +9 -0
- adeploy-1.0.0/docs/common/includes.md +103 -0
- adeploy-1.0.0/docs/common/index.md +31 -0
- adeploy-1.0.0/docs/common/labels.md +74 -0
- adeploy-1.0.0/docs/common/macros.md +43 -0
- adeploy-1.0.0/docs/common/probes.md +53 -0
- adeploy-1.0.0/docs/common/resource-limits.md +54 -0
- adeploy-1.0.0/docs/common/secrets.md +224 -0
- adeploy-1.0.0/docs/helm/helm-deploy.cast +69 -0
- adeploy-1.0.0/docs/helm/helm-render.cast +35 -0
- adeploy-1.0.0/docs/helm/helm-test.cast +37 -0
- adeploy-1.0.0/docs/helm/hooks.md +28 -0
- adeploy-1.0.0/docs/helm/index.md +117 -0
- adeploy-1.0.0/docs/helm.cast +133 -0
- adeploy-1.0.0/docs/hooks/asciinema.py +47 -0
- adeploy-1.0.0/docs/hooks/badges.py +64 -0
- adeploy-1.0.0/docs/index.md +17 -0
- adeploy-1.0.0/docs/install.md +7 -0
- adeploy-1.0.0/docs/jinja/index.md +106 -0
- adeploy-1.0.0/docs/jinja/jinja-deploy.cast +39 -0
- adeploy-1.0.0/docs/jinja/jinja-render.cast +39 -0
- adeploy-1.0.0/docs/jinja/jinja-test.cast +35 -0
- adeploy-1.0.0/docs/jinja.cast +243 -0
- adeploy-1.0.0/docs/overrides/partials/copyright.html +9 -0
- adeploy-1.0.0/docs/usage.md +232 -0
- adeploy-1.0.0/examples/.exclude-from-test +2 -0
- adeploy-1.0.0/examples/helm/001-quickstart/README.md +25 -0
- adeploy-1.0.0/examples/helm/001-quickstart/build/helm/charts/hello-world/.helmignore +23 -0
- adeploy-1.0.0/examples/helm/001-quickstart/build/helm/charts/hello-world/Chart.yaml +6 -0
- adeploy-1.0.0/examples/helm/001-quickstart/build/helm/charts/hello-world/README.md +1 -0
- adeploy-1.0.0/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/NOTES.txt +16 -0
- adeploy-1.0.0/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/_helpers.tpl +62 -0
- adeploy-1.0.0/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/deployment.yaml +33 -0
- adeploy-1.0.0/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/service.yaml +15 -0
- adeploy-1.0.0/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/serviceaccount.yaml +12 -0
- adeploy-1.0.0/examples/helm/001-quickstart/build/helm/charts/hello-world/values.yaml +27 -0
- adeploy-1.0.0/examples/helm/001-quickstart/build/helm/playground/hello-world/test/manifest.yml +75 -0
- adeploy-1.0.0/examples/helm/001-quickstart/build/helm/playground/hello-world/test/values.yml +18 -0
- adeploy-1.0.0/examples/helm/001-quickstart/defaults.yml +31 -0
- adeploy-1.0.0/examples/helm/001-quickstart/namespaces/playground/test.yml +26 -0
- adeploy-1.0.0/examples/helm/002-hooks/README.md +25 -0
- adeploy-1.0.0/examples/helm/002-hooks/build/helm/charts/hello-world/.helmignore +23 -0
- adeploy-1.0.0/examples/helm/002-hooks/build/helm/charts/hello-world/Chart.yaml +6 -0
- adeploy-1.0.0/examples/helm/002-hooks/build/helm/charts/hello-world/README.md +1 -0
- adeploy-1.0.0/examples/helm/002-hooks/build/helm/charts/hello-world/templates/NOTES.txt +16 -0
- adeploy-1.0.0/examples/helm/002-hooks/build/helm/charts/hello-world/templates/_helpers.tpl +62 -0
- adeploy-1.0.0/examples/helm/002-hooks/build/helm/charts/hello-world/templates/deployment.yaml +36 -0
- adeploy-1.0.0/examples/helm/002-hooks/build/helm/charts/hello-world/templates/service.yaml +15 -0
- adeploy-1.0.0/examples/helm/002-hooks/build/helm/charts/hello-world/templates/serviceaccount.yaml +12 -0
- adeploy-1.0.0/examples/helm/002-hooks/build/helm/charts/hello-world/values.yaml +27 -0
- adeploy-1.0.0/examples/helm/002-hooks/build/helm/playground/hello-world/test/manifest.yml +78 -0
- adeploy-1.0.0/examples/helm/002-hooks/build/helm/playground/hello-world/test/values.yml +18 -0
- adeploy-1.0.0/examples/helm/002-hooks/defaults.yml +31 -0
- adeploy-1.0.0/examples/helm/002-hooks/hooks/patch.sh +7 -0
- adeploy-1.0.0/examples/helm/002-hooks/hooks/patches.d/001-add-env.patch +12 -0
- adeploy-1.0.0/examples/helm/002-hooks/namespaces/playground/test.yml +26 -0
- adeploy-1.0.0/examples/jinja/001-general-structure/.exclude-from-test +1 -0
- adeploy-1.0.0/examples/jinja/001-general-structure/README.md +22 -0
- adeploy-1.0.0/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/prod/deployment.yml +52 -0
- adeploy-1.0.0/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/prod/job.yml +25 -0
- adeploy-1.0.0/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/test/deployment.yml +52 -0
- adeploy-1.0.0/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/test/job.yml +25 -0
- adeploy-1.0.0/examples/jinja/001-general-structure/defaults.yml +9 -0
- adeploy-1.0.0/examples/jinja/001-general-structure/namespaces/playground/prod.yml +10 -0
- adeploy-1.0.0/examples/jinja/001-general-structure/namespaces/playground/test.yml +3 -0
- adeploy-1.0.0/examples/jinja/001-general-structure/templates/deployment.yml +52 -0
- adeploy-1.0.0/examples/jinja/001-general-structure/templates/job.yml +25 -0
- adeploy-1.0.0/examples/jinja/002-secrets/README.md +27 -0
- adeploy-1.0.0/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/prod/secret-7e33ba97416ba4d45b6ce4c6c68b6aace36eacc5 +0 -0
- adeploy-1.0.0/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/prod/secret-e5e0c551a537d65bcea7c18eb47badaf9c09c349 +0 -0
- adeploy-1.0.0/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/test/secret-7929a442fae0ceee9eef9558a9a2ef02cc9d4421 +0 -0
- adeploy-1.0.0/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/test/secret-f310a9ad786b3fb5f7160436346e69795693b951 +0 -0
- adeploy-1.0.0/examples/jinja/002-secrets/build/jinja/playground/002-secrets/prod/deployment.yml +61 -0
- adeploy-1.0.0/examples/jinja/002-secrets/build/jinja/playground/002-secrets/test/deployment.yml +61 -0
- adeploy-1.0.0/examples/jinja/002-secrets/defaults.yml +5 -0
- adeploy-1.0.0/examples/jinja/002-secrets/namespaces/playground/prod.yml +13 -0
- adeploy-1.0.0/examples/jinja/002-secrets/namespaces/playground/secrets/my_secret_prod +1 -0
- adeploy-1.0.0/examples/jinja/002-secrets/namespaces/playground/secrets/my_secret_test +1 -0
- adeploy-1.0.0/examples/jinja/002-secrets/namespaces/playground/test.yml +12 -0
- adeploy-1.0.0/examples/jinja/002-secrets/templates/deployment.yml +60 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/README.md +28 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/prod/secret-6e1adb2c4c075e35335e851dd6ebc5f0f7397a80 +0 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/prod/secret-7e33ba97416ba4d45b6ce4c6c68b6aace36eacc5 +0 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/prod/secret-e5e0c551a537d65bcea7c18eb47badaf9c09c349 +0 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/test/secret-7929a442fae0ceee9eef9558a9a2ef02cc9d4421 +0 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/test/secret-dcf2a6e7bd78ee395f73f6434b19a9044790c00a +0 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/test/secret-f310a9ad786b3fb5f7160436346e69795693b951 +0 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/prod/deployment.yml +59 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/prod/ingress.yml +36 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/test/deployment.yml +59 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/test/ingress.yml +36 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/defaults.yml +5 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/namespaces/playground/prod.yml +28 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_prod/mydomain.com.crt +24 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_prod/mydomain.com.key +27 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_test/mydomain.com.crt +24 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_test/mydomain.com.key +27 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/my_secret_prod +1 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/my_secret_test +1 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/namespaces/playground/test.yml +29 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/templates/deployment.yml +58 -0
- adeploy-1.0.0/examples/jinja/002-secrets-ingress/templates/ingress.yml +35 -0
- adeploy-1.0.0/examples/jinja/003-include/README.md +24 -0
- adeploy-1.0.0/examples/jinja/003-include/build/jinja/playground/003-include/prod/common/configmap.yml +54 -0
- adeploy-1.0.0/examples/jinja/003-include/build/jinja/playground/003-include/prod/nginx/deployment.yml +74 -0
- adeploy-1.0.0/examples/jinja/003-include/build/jinja/playground/003-include/prod/redis/deployment.yml +80 -0
- adeploy-1.0.0/examples/jinja/003-include/build/jinja/playground/003-include/test/common/configmap.yml +54 -0
- adeploy-1.0.0/examples/jinja/003-include/build/jinja/playground/003-include/test/nginx/deployment.yml +74 -0
- adeploy-1.0.0/examples/jinja/003-include/build/jinja/playground/003-include/test/redis/deployment.yml +80 -0
- adeploy-1.0.0/examples/jinja/003-include/defaults.yml +15 -0
- adeploy-1.0.0/examples/jinja/003-include/namespaces/playground/prod.yml +2 -0
- adeploy-1.0.0/examples/jinja/003-include/namespaces/playground/test.yml +3 -0
- adeploy-1.0.0/examples/jinja/003-include/templates/common/__affinity.yml +18 -0
- adeploy-1.0.0/examples/jinja/003-include/templates/common/__env.yml +7 -0
- adeploy-1.0.0/examples/jinja/003-include/templates/common/configmap.yml +14 -0
- adeploy-1.0.0/examples/jinja/003-include/templates/files/conf.d/alpha.json +4 -0
- adeploy-1.0.0/examples/jinja/003-include/templates/files/conf.d/beta.json +4 -0
- adeploy-1.0.0/examples/jinja/003-include/templates/files/nginx.conf +31 -0
- adeploy-1.0.0/examples/jinja/003-include/templates/nginx/deployment.yml +50 -0
- adeploy-1.0.0/examples/jinja/003-include/templates/redis/deployment.yml +56 -0
- adeploy-1.0.0/examples/jinja/004-probes/README.md +27 -0
- adeploy-1.0.0/examples/jinja/004-probes/build/jinja/playground/004-probes/prod/nginx/deployment.yml +66 -0
- adeploy-1.0.0/examples/jinja/004-probes/build/jinja/playground/004-probes/prod/redis/deployment.yml +58 -0
- adeploy-1.0.0/examples/jinja/004-probes/build/jinja/playground/004-probes/test/nginx/deployment.yml +66 -0
- adeploy-1.0.0/examples/jinja/004-probes/build/jinja/playground/004-probes/test/redis/deployment.yml +58 -0
- adeploy-1.0.0/examples/jinja/004-probes/defaults.yml +36 -0
- adeploy-1.0.0/examples/jinja/004-probes/namespaces/playground/prod.yml +2 -0
- adeploy-1.0.0/examples/jinja/004-probes/namespaces/playground/test.yml +3 -0
- adeploy-1.0.0/examples/jinja/004-probes/templates/nginx/deployment.yml +53 -0
- adeploy-1.0.0/examples/jinja/004-probes/templates/redis/deployment.yml +52 -0
- adeploy-1.0.0/examples/jinja/005-labels/README.md +26 -0
- adeploy-1.0.0/examples/jinja/005-labels/build/jinja/playground/005-labels/prod/deployment.yml +51 -0
- adeploy-1.0.0/examples/jinja/005-labels/build/jinja/playground/005-labels/test/deployment.yml +51 -0
- adeploy-1.0.0/examples/jinja/005-labels/defaults.yml +20 -0
- adeploy-1.0.0/examples/jinja/005-labels/namespaces/playground/prod.yml +2 -0
- adeploy-1.0.0/examples/jinja/005-labels/namespaces/playground/test.yml +3 -0
- adeploy-1.0.0/examples/jinja/005-labels/templates/deployment.yml +45 -0
- adeploy-1.0.0/examples/jinja/006-nested-labels/README.md +26 -0
- adeploy-1.0.0/examples/jinja/006-nested-labels/build/jinja/playground/006-nested-labels/prod/deployment.yml +51 -0
- adeploy-1.0.0/examples/jinja/006-nested-labels/build/jinja/playground/006-nested-labels/test/deployment.yml +51 -0
- adeploy-1.0.0/examples/jinja/006-nested-labels/defaults.yml +10 -0
- adeploy-1.0.0/examples/jinja/006-nested-labels/namespaces/playground/prod.yml +2 -0
- adeploy-1.0.0/examples/jinja/006-nested-labels/namespaces/playground/test.yml +3 -0
- adeploy-1.0.0/examples/jinja/006-nested-labels/templates/deployment.yml +45 -0
- adeploy-1.0.0/examples/jinja/007-resources/README.md +28 -0
- adeploy-1.0.0/examples/jinja/007-resources/build/jinja/playground/007-resources/prod/nginx/deployment.yml +53 -0
- adeploy-1.0.0/examples/jinja/007-resources/build/jinja/playground/007-resources/prod/redis/deployment.yml +53 -0
- adeploy-1.0.0/examples/jinja/007-resources/build/jinja/playground/007-resources/test/nginx/deployment.yml +53 -0
- adeploy-1.0.0/examples/jinja/007-resources/build/jinja/playground/007-resources/test/redis/deployment.yml +53 -0
- adeploy-1.0.0/examples/jinja/007-resources/defaults.yml +46 -0
- adeploy-1.0.0/examples/jinja/007-resources/namespaces/playground/prod.yml +2 -0
- adeploy-1.0.0/examples/jinja/007-resources/namespaces/playground/test.yml +3 -0
- adeploy-1.0.0/examples/jinja/007-resources/templates/nginx/deployment.yml +46 -0
- adeploy-1.0.0/examples/jinja/007-resources/templates/redis/deployment.yml +46 -0
- adeploy-1.0.0/mkdocs.yml +86 -0
- adeploy-1.0.0/pyproject.toml +46 -0
- adeploy-1.0.0/requirements.txt +8 -0
- adeploy-1.0.0/runner.py +6 -0
- adeploy-1.0.0/setup.cfg +4 -0
- adeploy-1.0.0/setup.py +20 -0
adeploy-1.0.0/.gitignore
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Created by .ignore support plugin (hsz.mobi)
|
|
2
|
+
### Python template
|
|
3
|
+
# Byte-compiled / optimized / DLL files
|
|
4
|
+
__pycache__/
|
|
5
|
+
*.py[cod]
|
|
6
|
+
*$py.class
|
|
7
|
+
|
|
8
|
+
# C extensions
|
|
9
|
+
*.so
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
/build/
|
|
14
|
+
develop-eggs/
|
|
15
|
+
dist/
|
|
16
|
+
downloads/
|
|
17
|
+
eggs/
|
|
18
|
+
.eggs/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.coverage
|
|
43
|
+
.coverage.*
|
|
44
|
+
.cache
|
|
45
|
+
nosetests.xml
|
|
46
|
+
coverage.xml
|
|
47
|
+
*.cover
|
|
48
|
+
.hypothesis/
|
|
49
|
+
.pytest_cache/
|
|
50
|
+
|
|
51
|
+
# Translations
|
|
52
|
+
*.mo
|
|
53
|
+
*.pot
|
|
54
|
+
|
|
55
|
+
# Django stuff:
|
|
56
|
+
*.log
|
|
57
|
+
local_settings.py
|
|
58
|
+
db.sqlite3
|
|
59
|
+
|
|
60
|
+
# Flask stuff:
|
|
61
|
+
instance/
|
|
62
|
+
.webassets-cache
|
|
63
|
+
|
|
64
|
+
# Scrapy stuff:
|
|
65
|
+
.scrapy
|
|
66
|
+
|
|
67
|
+
# Sphinx documentation
|
|
68
|
+
docs/_build/
|
|
69
|
+
|
|
70
|
+
# PyBuilder
|
|
71
|
+
target/
|
|
72
|
+
|
|
73
|
+
# Jupyter Notebook
|
|
74
|
+
.ipynb_checkpoints
|
|
75
|
+
|
|
76
|
+
# pyenv
|
|
77
|
+
.python-version
|
|
78
|
+
|
|
79
|
+
# celery beat schedule file
|
|
80
|
+
celerybeat-schedule
|
|
81
|
+
|
|
82
|
+
# SageMath parsed files
|
|
83
|
+
*.sage.py
|
|
84
|
+
|
|
85
|
+
# Environments
|
|
86
|
+
.env
|
|
87
|
+
.venv
|
|
88
|
+
env/
|
|
89
|
+
venv/
|
|
90
|
+
ENV/
|
|
91
|
+
env.bak/
|
|
92
|
+
venv.bak/
|
|
93
|
+
|
|
94
|
+
# Spyder project settings
|
|
95
|
+
.spyderproject
|
|
96
|
+
.spyproject
|
|
97
|
+
|
|
98
|
+
# Rope project settings
|
|
99
|
+
.ropeproject
|
|
100
|
+
|
|
101
|
+
# mkdocs documentation
|
|
102
|
+
/site
|
|
103
|
+
|
|
104
|
+
# mypy
|
|
105
|
+
.mypy_cache/
|
|
106
|
+
|
|
107
|
+
.idea/
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
include:
|
|
2
|
+
- project: awesome/cicd
|
|
3
|
+
file: common.yml
|
|
4
|
+
ref: v1.0
|
|
5
|
+
- project: awesome/cicd
|
|
6
|
+
file: mkdocs.yml
|
|
7
|
+
ref: v1.0
|
|
8
|
+
- project: awesome/cicd
|
|
9
|
+
file: python.yml
|
|
10
|
+
ref: v1.0
|
|
11
|
+
|
|
12
|
+
.install_common: &install_common |
|
|
13
|
+
test -z "$SLEEP" || debug_sleep
|
|
14
|
+
apt-get update
|
|
15
|
+
apt-get install -y apt-transport-https ca-certificates curl gpg jq
|
|
16
|
+
|
|
17
|
+
.install_helm: &install_helm |
|
|
18
|
+
test -z "$SLEEP" || debug_sleep
|
|
19
|
+
helm_version=$(curl -s https://api.github.com/repos/helm/helm/releases | jq '.[] | select( .tag_name | contains("v3")) | select( .tag_name | contains("rc") | not ) | .tag_name' -r | head -n1)
|
|
20
|
+
curl -L https://get.helm.sh/helm-${helm_version}-linux-amd64.tar.gz | tar xvz
|
|
21
|
+
mv linux-amd64/helm /usr/bin/helm
|
|
22
|
+
chmod +x /usr/bin/helm
|
|
23
|
+
rm -r linux-amd64
|
|
24
|
+
echo "Installed helm $(helm version --short)"
|
|
25
|
+
|
|
26
|
+
.install_kubectl: &install_kubectl |
|
|
27
|
+
test -z "$SLEEP" || debug_sleep
|
|
28
|
+
kubectl_version=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
|
|
29
|
+
curl -LO https://storage.googleapis.com/kubernetes-release/release/${kubectl_version}/bin/linux/amd64/kubectl
|
|
30
|
+
mv kubectl /usr/bin/kubectl
|
|
31
|
+
chmod +x /usr/bin/kubectl
|
|
32
|
+
echo "Installed kubectl $(kubectl version --client -o json | jq .clientVersion.gitVersion -r)"
|
|
33
|
+
|
|
34
|
+
.install_adeploy: &install_adeploy |
|
|
35
|
+
test -z "$SLEEP" || debug_sleep
|
|
36
|
+
python -m venv adeploy
|
|
37
|
+
source adeploy/bin/activate
|
|
38
|
+
pip install -e .
|
|
39
|
+
echo "Installed adeploy $(python runner.py --version)"
|
|
40
|
+
|
|
41
|
+
.test_adeploy_jinja: &test_adeploy_jinja |
|
|
42
|
+
test -z "$SLEEP" || debug_sleep
|
|
43
|
+
for dir in examples/jinja/*
|
|
44
|
+
do
|
|
45
|
+
pushd $dir
|
|
46
|
+
mv build build.orig
|
|
47
|
+
python ../../../runner.py -d -p jinja render .
|
|
48
|
+
if [[ -e ".exclude-from-test" ]] ; then
|
|
49
|
+
diff -ru --exclude-from=../../.exclude-from-test --exclude-from=.exclude-from-test build build.orig
|
|
50
|
+
else
|
|
51
|
+
diff -ru --exclude-from=../../.exclude-from-test build build.orig
|
|
52
|
+
fi
|
|
53
|
+
popd
|
|
54
|
+
done
|
|
55
|
+
|
|
56
|
+
.test_adeploy_helm: &test_adeploy_helm |
|
|
57
|
+
test -z "$SLEEP" || debug_sleep
|
|
58
|
+
for dir in examples/helm/*
|
|
59
|
+
do
|
|
60
|
+
pushd $dir
|
|
61
|
+
mv build build.orig
|
|
62
|
+
python ../../../runner.py -d -p helm --skip-validate render .
|
|
63
|
+
if [[ -e ".exclude-from-test" ]] ; then
|
|
64
|
+
diff -ru --exclude-from=../../.exclude-from-test --exclude-from=.exclude-from-test build build.orig
|
|
65
|
+
else
|
|
66
|
+
diff -ru --exclude-from=../../.exclude-from-test build build.orig
|
|
67
|
+
fi
|
|
68
|
+
popd
|
|
69
|
+
done
|
|
70
|
+
|
|
71
|
+
adeploy-test-python3.8:
|
|
72
|
+
stage: test
|
|
73
|
+
image: registry.awesome-it.de/upstream-dockerhub/python:3.8
|
|
74
|
+
script:
|
|
75
|
+
- *install_common
|
|
76
|
+
- *install_kubectl
|
|
77
|
+
- *install_adeploy
|
|
78
|
+
- *test_adeploy_jinja
|
|
79
|
+
- *install_helm
|
|
80
|
+
- *test_adeploy_helm
|
|
81
|
+
rules:
|
|
82
|
+
- if: ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'main' || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'master')
|
|
83
|
+
|
|
84
|
+
adeploy-test-python3.12:
|
|
85
|
+
stage: test
|
|
86
|
+
image: registry.awesome-it.de/upstream-dockerhub/python:3.12
|
|
87
|
+
script:
|
|
88
|
+
- *install_common
|
|
89
|
+
- *install_kubectl
|
|
90
|
+
- *install_adeploy
|
|
91
|
+
- *test_adeploy_jinja
|
|
92
|
+
- *install_helm
|
|
93
|
+
- *test_adeploy_helm
|
|
94
|
+
rules:
|
|
95
|
+
- if: ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'main' || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'master')
|
adeploy-1.0.0/DEVELOP.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# adeploy
|
|
2
|
+
|
|
3
|
+
This doc is for developers.
|
|
4
|
+
|
|
5
|
+
## Setup for development usage
|
|
6
|
+
|
|
7
|
+
Get the source code:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
$ git clone https://gitlab.awesome-it.de/tools/adeploy.git ~/path/to/atracker
|
|
11
|
+
```
|
|
12
|
+
Setup a virtualenv using `Python3` and activate it:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
$ virtualenv -p python3 ~/.virtualenvs/adeploy
|
|
16
|
+
$ source ~/.virtualenvs/adeploy/bin/activate
|
|
17
|
+
# alternatively install it in your project directory
|
|
18
|
+
$ cd ~/path/to/adeploy
|
|
19
|
+
$ virtualenv -p python3 env3
|
|
20
|
+
$ source env3/bin/activate
|
|
21
|
+
(adeploy)$
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Install requirements:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
(adeploy)$ pip install -r requirements.txt
|
|
28
|
+
```
|
|
29
|
+
#### Usage while developing
|
|
30
|
+
|
|
31
|
+
There are two ways you can invoke adeploy while developing (i.e. while in your virtualenv).
|
|
32
|
+
|
|
33
|
+
1. There is a wrapper that can be used to run it from your PATH. This is only intended for quick usage while development,
|
|
34
|
+
not as a binary (i.e. don't link to it or anything; have a look at the next topic).
|
|
35
|
+
```bash
|
|
36
|
+
$ ./runner.py
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. The second way is via pip. Pip can install a python package in edit-mode. If you do this all code changes will
|
|
40
|
+
immediately take effect. To skip the virtualenv, you can append "--user" to pip in order to install adeploy using the user scheme.
|
|
41
|
+
```bash
|
|
42
|
+
$ cd ~/path/to/adeploy
|
|
43
|
+
$ pip install [--user] -e .
|
|
44
|
+
$ adeploy
|
|
45
|
+
# make changes
|
|
46
|
+
$ adeploy
|
|
47
|
+
# new behaviour, changes take effect immediately.
|
|
48
|
+
````
|
|
49
|
+
|
|
50
|
+
## Writing Documentation
|
|
51
|
+
|
|
52
|
+
The docs are build via [MkDocs Material](https://squidfunk.github.io/mkdocs-material/), the markdown files are located in the `docs` subfolder.
|
|
53
|
+
|
|
54
|
+
In order to create the docs, you need to install `mkdocs-material` and dependencies as follows:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pipx install mkdocs-material
|
|
58
|
+
pipx inject mkdocs-material beautifulsoup4 # Required for hooks/asciinema.py
|
|
59
|
+
pipx inject mkdocs-material "mkdocstrings[python]" # Required to read docstrings from python files i.e. filters.py
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Now you run the `mkdocs` live preview at http://127.0.0.1:8000/ as follows:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
mkdocs serve
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Or generate static docs as:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
mkdocs build
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Terminal records via `asciinema`
|
|
75
|
+
|
|
76
|
+
Install `asciinema` as follows:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pipx install asciinema
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
To record you terminal sessions, use the following:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
asciinema rec -c "bash --rcfile ~/.bashrc-asciinema" --rows 10 --cols 75 <output_file>.cast
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Make sure to set your `PS1` variable to `$ ` in your `~/.bashrc-asciinema`.
|
adeploy-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021, awesome information technology GmbH
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
adeploy-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: adeploy
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Universal deployment tool for Kubernetes that supports rendering and deployment of lightweight Jinja templated k8s manifests as well as complex Helm charts.
|
|
5
|
+
Author: awesome IT
|
|
6
|
+
Author-email: Daniel Morlock <daniel.morlock@awesome-it.de>, Daniel Bross <daniel.bross@awesome-it.de>, Robin Lutz <robin.lutz@awesome-it.de>, Adrian Vielsack <adrian.vielsack@awesome-it.de>, Philip Flohr <philip.flohr@awesome-it.de>
|
|
7
|
+
Project-URL: Homepage, https://awesome-it.de
|
|
8
|
+
Project-URL: Source, https://github.com/awesome-it/adeploy
|
|
9
|
+
Project-URL: Issues, https://github.com/awesome-it/adeploy/issues
|
|
10
|
+
Project-URL: Documentation, https://awesome-it.de/docs/adeploy/latest
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: colorama>=0.4.3
|
|
18
|
+
Requires-Dist: Jinja2
|
|
19
|
+
Requires-Dist: PyYAML
|
|
20
|
+
Requires-Dist: ruamel.yaml>=0.16.12
|
|
21
|
+
Requires-Dist: ruamel.yaml.clib>=0.2.2
|
|
22
|
+
Requires-Dist: packaging>=20.4
|
|
23
|
+
Requires-Dist: shortuuid>=1.0.1
|
|
24
|
+
Requires-Dist: watchdog>=3.0.0
|
|
25
|
+
|
|
26
|
+
# adeploy
|
|
27
|
+
|
|
28
|
+
<!-- --8<-- [start:intro] -->
|
|
29
|
+
|
|
30
|
+
We build `adeploy`, an universal deployment tool for Kubernetes that supports rendering and deployment of lightweight
|
|
31
|
+
Jinja templated k8s manifests and also Helm charts.
|
|
32
|
+
|
|
33
|
+
We’ve added support for ...
|
|
34
|
+
|
|
35
|
+
* using **Jinja variables** from per cluster, namespaces or release configuration
|
|
36
|
+
* easy **secret management** based on [Gopass](https://github.com/gopasspw/gopass) or other command line based password managers
|
|
37
|
+
* running deployment tests in **CI/CD pipelines**
|
|
38
|
+
* **previewing** and **patching** upstream [Helm Charts](https://artifacthub.io/) before deploying
|
|
39
|
+
* **extending** upstream Helm Charts with custom Jinja-templates manifests
|
|
40
|
+
* handy templating for **labels, annotations, probes, resource limits** and other metadata
|
|
41
|
+
|
|
42
|
+
... and even more to make your daily work with k8s easier.
|
|
43
|
+
|
|
44
|
+
<!-- --8<-- [end:intro] -->
|
|
45
|
+
|
|
46
|
+
## Documentation & Support
|
|
47
|
+
|
|
48
|
+
* `adeploy` is Open Source and hosted on GitHub: [https://github.com/awesome-it/adeploy](https://github.com/awesome-it/adeploy).
|
|
49
|
+
* You can report issues on GitHub: [https://github.com/awesome-it/adeploy/issues](https://github.com/awesome-it/adeploy/issues).
|
|
50
|
+
* Find the documentation at [https://awesome-it.de/docs/adeploy/latest](https://awesome-it.de/docs/adeploy/latest).
|
|
51
|
+
|
|
52
|
+
## Examples
|
|
53
|
+
|
|
54
|
+
This is how you can render, test (preview) and deploy a Helm Chart:
|
|
55
|
+
[](https://asciinema.org/a/iToqBOzT8t2Up6x6lRhjF0sk2)
|
|
56
|
+
|
|
57
|
+
Or you can render, test (preview) and deploy Jinja-templated manifests:
|
|
58
|
+
[](https://asciinema.org/a/li2ZqLa5pnh6pj1KWoOrUIHOe)
|
|
59
|
+
|
|
60
|
+
You'll find some examples in the [example](https://github.com/awesome-it/adeploy/tree/master/examples) directory.
|
|
61
|
+
|
|
62
|
+
## Getting Started
|
|
63
|
+
|
|
64
|
+
<!-- --8<-- [start:install] -->
|
|
65
|
+
|
|
66
|
+
You can find `adeploy` on [GitHub](https://github.com/awesome-it/adeploy). But it is recommended to install
|
|
67
|
+
or upgrade [adeploy](https://pipy.org/project/adeploy) using `pip`:
|
|
68
|
+
|
|
69
|
+
```shell
|
|
70
|
+
$ pip install adeploy
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Or use [pipx](https://github.com/pypa/pipx) to install, upgrade and run `adeploy` in an isolated environment:
|
|
74
|
+
|
|
75
|
+
```shell
|
|
76
|
+
$ pipx install adeploy
|
|
77
|
+
$ pipx upgrade adeploy
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
You should now be able to run `adeploy` from the command line:
|
|
81
|
+
|
|
82
|
+
```shell
|
|
83
|
+
adeploy --help
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
You can now start to use `adeploy`.
|
|
87
|
+
|
|
88
|
+
<!-- --8<-- [end:install] -->
|
|
89
|
+
|
|
90
|
+
See the [usage documentation](https://awesome-it.de/docs/adeploy/latest/usage/) to start using `adeploy`.
|
|
91
|
+
|
|
92
|
+
## Read More
|
|
93
|
+
|
|
94
|
+
* https://awesome-it.de/2020/09/11/adeploy-an-universal-deployment-tool-for-kubernetes/
|
adeploy-1.0.0/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# adeploy
|
|
2
|
+
|
|
3
|
+
<!-- --8<-- [start:intro] -->
|
|
4
|
+
|
|
5
|
+
We build `adeploy`, an universal deployment tool for Kubernetes that supports rendering and deployment of lightweight
|
|
6
|
+
Jinja templated k8s manifests and also Helm charts.
|
|
7
|
+
|
|
8
|
+
We’ve added support for ...
|
|
9
|
+
|
|
10
|
+
* using **Jinja variables** from per cluster, namespaces or release configuration
|
|
11
|
+
* easy **secret management** based on [Gopass](https://github.com/gopasspw/gopass) or other command line based password managers
|
|
12
|
+
* running deployment tests in **CI/CD pipelines**
|
|
13
|
+
* **previewing** and **patching** upstream [Helm Charts](https://artifacthub.io/) before deploying
|
|
14
|
+
* **extending** upstream Helm Charts with custom Jinja-templates manifests
|
|
15
|
+
* handy templating for **labels, annotations, probes, resource limits** and other metadata
|
|
16
|
+
|
|
17
|
+
... and even more to make your daily work with k8s easier.
|
|
18
|
+
|
|
19
|
+
<!-- --8<-- [end:intro] -->
|
|
20
|
+
|
|
21
|
+
## Documentation & Support
|
|
22
|
+
|
|
23
|
+
* `adeploy` is Open Source and hosted on GitHub: [https://github.com/awesome-it/adeploy](https://github.com/awesome-it/adeploy).
|
|
24
|
+
* You can report issues on GitHub: [https://github.com/awesome-it/adeploy/issues](https://github.com/awesome-it/adeploy/issues).
|
|
25
|
+
* Find the documentation at [https://awesome-it.de/docs/adeploy/latest](https://awesome-it.de/docs/adeploy/latest).
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
This is how you can render, test (preview) and deploy a Helm Chart:
|
|
30
|
+
[](https://asciinema.org/a/iToqBOzT8t2Up6x6lRhjF0sk2)
|
|
31
|
+
|
|
32
|
+
Or you can render, test (preview) and deploy Jinja-templated manifests:
|
|
33
|
+
[](https://asciinema.org/a/li2ZqLa5pnh6pj1KWoOrUIHOe)
|
|
34
|
+
|
|
35
|
+
You'll find some examples in the [example](https://github.com/awesome-it/adeploy/tree/master/examples) directory.
|
|
36
|
+
|
|
37
|
+
## Getting Started
|
|
38
|
+
|
|
39
|
+
<!-- --8<-- [start:install] -->
|
|
40
|
+
|
|
41
|
+
You can find `adeploy` on [GitHub](https://github.com/awesome-it/adeploy). But it is recommended to install
|
|
42
|
+
or upgrade [adeploy](https://pipy.org/project/adeploy) using `pip`:
|
|
43
|
+
|
|
44
|
+
```shell
|
|
45
|
+
$ pip install adeploy
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Or use [pipx](https://github.com/pypa/pipx) to install, upgrade and run `adeploy` in an isolated environment:
|
|
49
|
+
|
|
50
|
+
```shell
|
|
51
|
+
$ pipx install adeploy
|
|
52
|
+
$ pipx upgrade adeploy
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
You should now be able to run `adeploy` from the command line:
|
|
56
|
+
|
|
57
|
+
```shell
|
|
58
|
+
adeploy --help
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
You can now start to use `adeploy`.
|
|
62
|
+
|
|
63
|
+
<!-- --8<-- [end:install] -->
|
|
64
|
+
|
|
65
|
+
See the [usage documentation](https://awesome-it.de/docs/adeploy/latest/usage/) to start using `adeploy`.
|
|
66
|
+
|
|
67
|
+
## Read More
|
|
68
|
+
|
|
69
|
+
* https://awesome-it.de/2020/09/11/adeploy-an-universal-deployment-tool-for-kubernetes/
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import sys
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
from adeploy import steps
|
|
6
|
+
from adeploy.common import colors
|
|
7
|
+
from adeploy.common.helpers import get_submodules
|
|
8
|
+
|
|
9
|
+
__args: argparse.Namespace
|
|
10
|
+
__unknown_args: argparse.Namespace
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def get_args():
|
|
14
|
+
global __args
|
|
15
|
+
return __args
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def parse(parser: argparse.ArgumentParser):
|
|
19
|
+
global __args, __unknown_args
|
|
20
|
+
|
|
21
|
+
# Pass --help to a provider if a provider was already specified
|
|
22
|
+
if ('--help' in sys.argv or '-h' in sys.argv) and ('--provider' in sys.argv or '-p' in sys.argv):
|
|
23
|
+
real_args = list(filter(lambda x: x not in ['--help', '-h'], sys.argv))
|
|
24
|
+
args, unknown_args = parser.parse_known_args(real_args[1:])
|
|
25
|
+
unknown_args.append('--help')
|
|
26
|
+
else:
|
|
27
|
+
args, unknown_args = parser.parse_known_args()
|
|
28
|
+
|
|
29
|
+
__args = args
|
|
30
|
+
__unknown_args = unknown_args
|
|
31
|
+
|
|
32
|
+
return args, unknown_args
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def setup_parser():
|
|
36
|
+
parser = argparse.ArgumentParser(description='An awesome universal deployment tool for k8s',
|
|
37
|
+
usage=colors.bold(
|
|
38
|
+
f'adeploy -p {colors.blue("provider")} {colors.gray("[optional args ...]")} '
|
|
39
|
+
f'{colors.blue("build-step")} {colors.gray("[optional build args ...]")} '
|
|
40
|
+
f'{colors.blue("src_dir")} [{colors.blue("src_dir")} ...]'))
|
|
41
|
+
|
|
42
|
+
parser.add_argument('-l', '--log', dest='logfile', help='Path to logfile')
|
|
43
|
+
|
|
44
|
+
parser.add_argument('-d', '--debug', action='store_true')
|
|
45
|
+
|
|
46
|
+
parser.add_argument('-s', '--skip-colors', dest='skip_colors', action='store_true')
|
|
47
|
+
|
|
48
|
+
parser.add_argument('-f', '--force', dest='force', action='store_true')
|
|
49
|
+
|
|
50
|
+
parser.add_argument('-p', '--provider', dest='provider',
|
|
51
|
+
help='The provider to use, type --providers to get a list of supported providers.',
|
|
52
|
+
required='--providers' not in sys.argv and '--version' not in sys.argv)
|
|
53
|
+
|
|
54
|
+
parser.add_argument('--providers', dest='list_providers', action='store_true',
|
|
55
|
+
help='A list of supported providers')
|
|
56
|
+
|
|
57
|
+
parser.add_argument('-n', '--name', dest="deployment_name", default=None,
|
|
58
|
+
help='Specify a deployment name. This will overwrite deployment name derived from repo dir')
|
|
59
|
+
|
|
60
|
+
parser.add_argument('--adeploy-dir', dest='adeploy_dir',
|
|
61
|
+
help='Configuration directory for adeploy', default=Path.home().joinpath('.adeploy'),
|
|
62
|
+
metavar='adeploy_dir', type=Path)
|
|
63
|
+
|
|
64
|
+
parser.add_argument('--build-dir', dest='build_dir',
|
|
65
|
+
help='Build directory for output', default='./build', metavar='build_dir')
|
|
66
|
+
|
|
67
|
+
parser.add_argument('--defaults', dest='defaults_path', default='defaults.yml',
|
|
68
|
+
help='YML file or directory containing <deployment_name>.yml with default variables. '
|
|
69
|
+
'Relative to source dirs.')
|
|
70
|
+
|
|
71
|
+
parser.add_argument('--namespaces', dest='namespaces_dir', default='namespaces',
|
|
72
|
+
help='Directory containing namespaces and variables for deployments')
|
|
73
|
+
|
|
74
|
+
parser.add_argument('--recreate-secrets', dest='recreate_secrets', action='store_true',
|
|
75
|
+
help='Force to re-create secrets. This might invoke a password store to retrieve secrets.')
|
|
76
|
+
|
|
77
|
+
parser.add_argument('--filter-namespace', dest='filters_namespace', nargs='+', action='append',
|
|
78
|
+
help='Only include specified namespace. Argument can be specified multiple times.')
|
|
79
|
+
|
|
80
|
+
parser.add_argument('--filter-release', dest='filters_release', nargs='+', action='append',
|
|
81
|
+
help='Only include specified deployment release i.e. "prod", "testing". '
|
|
82
|
+
'Argument can be specified multiple times.')
|
|
83
|
+
|
|
84
|
+
parser.add_argument('--show-configs', dest='show_configs', action='store_true', default=False,
|
|
85
|
+
help='Print out rendered namespace configurations and quit.')
|
|
86
|
+
|
|
87
|
+
parser.add_argument('--gopass-repo', dest='gopass_repo', nargs='+', action='append',
|
|
88
|
+
help='Gopass repo names, where the awesome secrets are stored. This argument can be specified '
|
|
89
|
+
'multiple times for multiple Gpoass repos. This params can also be specified by the env '
|
|
90
|
+
'var ADEPLOY_GOPASS_REPOS where comma separated list of Gopass repo names is expected. '
|
|
91
|
+
'If args are specified, these take precedence and the env var is ignored.')
|
|
92
|
+
|
|
93
|
+
parser.add_argument('--version', action='store_true', help='Print version and exit')
|
|
94
|
+
|
|
95
|
+
subparsers = parser.add_subparsers(title=f'Available build steps', metavar=colors.bold('build-steps'))
|
|
96
|
+
|
|
97
|
+
for (module, class_name) in get_submodules(steps):
|
|
98
|
+
module_name = module.__name__
|
|
99
|
+
subparser = subparsers.add_parser(module_name,
|
|
100
|
+
help=f'Call module "{module_name}", '
|
|
101
|
+
f'type: {sys.argv[0]} {module_name} --help for more options')
|
|
102
|
+
subparser.add_argument("src_dirs",
|
|
103
|
+
help="Directory containing deployment sources",
|
|
104
|
+
nargs='*', default='.', metavar='src_dir')
|
|
105
|
+
|
|
106
|
+
if module_name == 'config':
|
|
107
|
+
subparser.add_argument("-o,--out", dest='config_out', default="",
|
|
108
|
+
help="Filename to store the rendered namespace configurations as JSON.")
|
|
109
|
+
|
|
110
|
+
subparser.add_argument(f'--{module_name}', default=True, help=argparse.SUPPRESS)
|
|
111
|
+
|
|
112
|
+
return parser
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from colorama import Style, Fore
|
|
2
|
+
|
|
3
|
+
_skip_colors = False
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def skip_colors(skip=True):
|
|
7
|
+
global _skip_colors
|
|
8
|
+
_skip_colors = skip
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def blue(text):
|
|
12
|
+
return f'{Fore.BLUE}{text}{Fore.RESET}' if not _skip_colors else text
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def green(text):
|
|
16
|
+
return f'{Fore.GREEN}{text}{Fore.RESET}' if not _skip_colors else text
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def red(text):
|
|
20
|
+
return f'{Fore.RED}{text}{Fore.RESET}' if not _skip_colors else text
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def orange(text):
|
|
24
|
+
return f'{Fore.YELLOW}{text}{Fore.RESET}' if not _skip_colors else text
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def gray(text):
|
|
28
|
+
# Fore.Gray is not readable in some terminals.
|
|
29
|
+
return f'{Fore.RESET}{text}' if not _skip_colors else text
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def bold(text):
|
|
33
|
+
return f'{Style.BRIGHT}{text}{Style.NORMAL}' if not _skip_colors else text
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def red_bold(text):
|
|
37
|
+
return bold(red(text))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def green_bold(text):
|
|
41
|
+
return bold(green(text))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def blue_bold(text):
|
|
45
|
+
return bold(blue(text))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def orange_bold(text):
|
|
49
|
+
return bold(orange(text))
|