adeploy 1.3.0__tar.gz → 1.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.
- {adeploy-1.3.0 → adeploy-1.3.1}/PKG-INFO +1 -1
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/hooks/asciinema.py +5 -6
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/hooks/badges.py +10 -14
- {adeploy-1.3.0 → adeploy-1.3.1}/pyproject.toml +4 -1
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/__main__.py +1 -1
- adeploy-1.3.1/src/adeploy/common/args.py +184 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/colors.py +7 -7
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/deployment.py +66 -41
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/errors.py +12 -5
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/helpers.py +33 -17
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/jinja/dict.py +3 -4
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/jinja/env.py +29 -16
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/jinja/filters.py +8 -8
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/jinja/globals.py +214 -113
- adeploy-1.3.1/src/adeploy/common/kubectl.py +259 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/logging.py +6 -5
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/provider.py +98 -43
- adeploy-1.3.1/src/adeploy/common/secrets/__init__.py +6 -0
- adeploy-1.3.1/src/adeploy/common/secrets/docker_registry_secret.py +62 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/secrets/generic_secret.py +26 -13
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/secrets/secret.py +142 -72
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/secrets/tls_secret.py +38 -16
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/secrets_provider/gopass_provider.py +66 -39
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/secrets_provider/plaintext_provider.py +8 -4
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/secrets_provider/provider.py +14 -5
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/secrets_provider/random_provider.py +10 -9
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/secrets_provider/shell_command_provider.py +7 -4
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/version.py +2 -2
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/yaml/__init__.py +1 -1
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/yaml/find.py +2 -3
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/yaml/labels.py +15 -15
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/yaml/probes.py +14 -11
- adeploy-1.3.1/src/adeploy/common/yaml/resources.py +39 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/main.py +16 -12
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/providers/helm/__init__.py +2 -0
- adeploy-1.3.1/src/adeploy/providers/helm/common/__init__.py +25 -0
- adeploy-1.3.1/src/adeploy/providers/helm/common/helm.py +136 -0
- adeploy-1.3.1/src/adeploy/providers/helm/common/helm_output.py +24 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/providers/helm/common/helm_provider.py +2 -2
- adeploy-1.3.1/src/adeploy/providers/helm/deployer.py +87 -0
- adeploy-1.3.1/src/adeploy/providers/helm/renderer.py +240 -0
- adeploy-1.3.1/src/adeploy/providers/helm/tester.py +235 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/providers/helm/watcher.py +4 -5
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/providers/jinja/__init__.py +3 -1
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/providers/jinja/deployer.py +22 -18
- adeploy-1.3.1/src/adeploy/providers/jinja/renderer.py +188 -0
- adeploy-1.3.1/src/adeploy/providers/jinja/tester.py +72 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/providers/jinja/watcher.py +123 -50
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/steps/__init__.py +2 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/steps/config.py +11 -8
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/steps/deploy.py +30 -18
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/steps/render.py +20 -13
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/steps/test.py +25 -17
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/steps/watch.py +20 -13
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy.egg-info/PKG-INFO +1 -1
- adeploy-1.3.0/src/adeploy/common/args.py +0 -112
- adeploy-1.3.0/src/adeploy/common/kubectl.py +0 -202
- adeploy-1.3.0/src/adeploy/common/secrets/__init__.py +0 -4
- adeploy-1.3.0/src/adeploy/common/secrets/docker_registry_secret.py +0 -45
- adeploy-1.3.0/src/adeploy/common/yaml/resources.py +0 -35
- adeploy-1.3.0/src/adeploy/providers/helm/common/__init__.py +0 -3
- adeploy-1.3.0/src/adeploy/providers/helm/common/helm.py +0 -98
- adeploy-1.3.0/src/adeploy/providers/helm/common/helm_output.py +0 -26
- adeploy-1.3.0/src/adeploy/providers/helm/deployer.py +0 -61
- adeploy-1.3.0/src/adeploy/providers/helm/renderer.py +0 -181
- adeploy-1.3.0/src/adeploy/providers/helm/tester.py +0 -159
- adeploy-1.3.0/src/adeploy/providers/jinja/renderer.py +0 -142
- adeploy-1.3.0/src/adeploy/providers/jinja/tester.py +0 -61
- {adeploy-1.3.0 → adeploy-1.3.1}/.awesome.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/.gitignore +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/.gitlab-ci.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/DEVELOP.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/LICENSE +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/assets/css/asciinema-player.css +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/assets/css/badges.css +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/assets/css/docstrings.css +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/assets/css/footer.css +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/assets/download.sh +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/assets/img/awesome-logo.png +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/assets/js/asciinema-init.js +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/assets/js/asciinema-player.min.js +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/common/_more.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/common/filters.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/common/functions.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/common/includes.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/common/index.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/common/labels.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/common/macros.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/common/probes.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/common/resource-limits.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/common/secrets.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/helm/helm-deploy.cast +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/helm/helm-render.cast +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/helm/helm-test.cast +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/helm/hooks.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/helm/index.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/helm.cast +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/index.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/install.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/jinja/index.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/jinja/jinja-deploy.cast +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/jinja/jinja-render.cast +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/jinja/jinja-test.cast +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/jinja.cast +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/overrides/partials/copyright.html +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/docs/usage.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/.exclude-from-test +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/build/helm/charts/hello-world/.helmignore +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/build/helm/charts/hello-world/Chart.yaml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/build/helm/charts/hello-world/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/NOTES.txt +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/_helpers.tpl +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/deployment.yaml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/service.yaml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/serviceaccount.yaml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/build/helm/charts/hello-world/values.yaml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/build/helm/playground/hello-world/test/manifest.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/build/helm/playground/hello-world/test/values.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/defaults.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/001-quickstart/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/build/helm/charts/hello-world/.helmignore +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/build/helm/charts/hello-world/Chart.yaml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/build/helm/charts/hello-world/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/NOTES.txt +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/_helpers.tpl +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/deployment.yaml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/service.yaml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/serviceaccount.yaml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/build/helm/charts/hello-world/values.yaml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/build/helm/playground/hello-world/test/manifest.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/build/helm/playground/hello-world/test/values.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/defaults.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/hooks/patch.sh +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/hooks/patches.d/001-add-env.patch +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/helm/002-hooks/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/001-general-structure/.exclude-from-test +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/001-general-structure/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/prod/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/prod/job.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/test/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/test/job.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/001-general-structure/defaults.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/001-general-structure/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/001-general-structure/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/001-general-structure/templates/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/001-general-structure/templates/job.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/prod/secret-7e33ba97416ba4d45b6ce4c6c68b6aace36eacc5 +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/prod/secret-e5e0c551a537d65bcea7c18eb47badaf9c09c349 +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/test/secret-7929a442fae0ceee9eef9558a9a2ef02cc9d4421 +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/test/secret-f310a9ad786b3fb5f7160436346e69795693b951 +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets/build/jinja/playground/002-secrets/prod/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets/build/jinja/playground/002-secrets/test/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets/defaults.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets/namespaces/playground/secrets/my_secret_prod +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets/namespaces/playground/secrets/my_secret_test +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets/templates/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/prod/secret-6e1adb2c4c075e35335e851dd6ebc5f0f7397a80 +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/prod/secret-7e33ba97416ba4d45b6ce4c6c68b6aace36eacc5 +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/prod/secret-e5e0c551a537d65bcea7c18eb47badaf9c09c349 +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/test/secret-7929a442fae0ceee9eef9558a9a2ef02cc9d4421 +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/test/secret-dcf2a6e7bd78ee395f73f6434b19a9044790c00a +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/test/secret-f310a9ad786b3fb5f7160436346e69795693b951 +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/prod/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/prod/ingress.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/test/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/test/ingress.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/defaults.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_prod/mydomain.com.crt +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_prod/mydomain.com.key +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_test/mydomain.com.crt +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_test/mydomain.com.key +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/my_secret_prod +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/my_secret_test +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/templates/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/002-secrets-ingress/templates/ingress.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/build/jinja/playground/003-include/prod/common/configmap.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/build/jinja/playground/003-include/prod/nginx/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/build/jinja/playground/003-include/prod/redis/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/build/jinja/playground/003-include/test/common/configmap.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/build/jinja/playground/003-include/test/nginx/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/build/jinja/playground/003-include/test/redis/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/defaults.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/templates/common/__affinity.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/templates/common/__env.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/templates/common/configmap.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/templates/files/conf.d/alpha.json +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/templates/files/conf.d/beta.json +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/templates/files/nginx.conf +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/templates/nginx/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/003-include/templates/redis/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/004-probes/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/004-probes/build/jinja/playground/004-probes/prod/nginx/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/004-probes/build/jinja/playground/004-probes/prod/redis/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/004-probes/build/jinja/playground/004-probes/test/nginx/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/004-probes/build/jinja/playground/004-probes/test/redis/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/004-probes/defaults.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/004-probes/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/004-probes/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/004-probes/templates/nginx/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/004-probes/templates/redis/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/005-labels/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/005-labels/build/jinja/playground/005-labels/prod/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/005-labels/build/jinja/playground/005-labels/test/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/005-labels/defaults.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/005-labels/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/005-labels/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/005-labels/templates/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/006-nested-labels/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/006-nested-labels/build/jinja/playground/006-nested-labels/prod/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/006-nested-labels/build/jinja/playground/006-nested-labels/test/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/006-nested-labels/defaults.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/006-nested-labels/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/006-nested-labels/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/006-nested-labels/templates/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/007-resources/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/007-resources/build/jinja/playground/007-resources/prod/nginx/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/007-resources/build/jinja/playground/007-resources/prod/redis/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/007-resources/build/jinja/playground/007-resources/test/nginx/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/007-resources/build/jinja/playground/007-resources/test/redis/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/007-resources/defaults.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/007-resources/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/007-resources/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/007-resources/templates/nginx/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/examples/jinja/007-resources/templates/redis/deployment.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/mkdocs.yml +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/setup.cfg +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/__init__.py +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/__init__.py +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/jinja/__init__.py +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/secrets_provider/__init__.py +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/common/yaml/update.py +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/providers/__init__.py +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/providers/helm/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy/providers/jinja/README.md +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy.egg-info/SOURCES.txt +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy.egg-info/dependency_links.txt +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy.egg-info/entry_points.txt +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy.egg-info/requires.txt +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/src/adeploy.egg-info/top_level.txt +0 -0
- {adeploy-1.3.0 → adeploy-1.3.1}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: adeploy
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.1
|
|
4
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
5
|
Author-email: Daniel Morlock <daniel.morlock@awesome-it.de>, Daniel Bross <daniel.bross@awesome-it.de>, Adrian Vielsack <adrian.vielsack@awesome-it.de>, Philip Flohr <philip.flohr@awesome-it.de>
|
|
6
6
|
License-Expression: BSD-3-Clause
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import copy
|
|
2
1
|
import json
|
|
3
2
|
from bs4 import BeautifulSoup
|
|
4
3
|
|
|
@@ -12,18 +11,17 @@ def on_post_page(output, page, config):
|
|
|
12
11
|
if 'alt="asciicast"' not in output:
|
|
13
12
|
return output
|
|
14
13
|
|
|
15
|
-
soup = BeautifulSoup(output,
|
|
14
|
+
soup = BeautifulSoup(output, "html.parser")
|
|
16
15
|
asciicast_elements = soup.findAll("img", {"alt": "asciicast"})
|
|
17
16
|
asciicasts = []
|
|
18
17
|
for idx, element in enumerate(asciicast_elements):
|
|
19
|
-
asciicast_id = f
|
|
20
|
-
asciicast_src = element.attrs[
|
|
18
|
+
asciicast_id = f"asciicast-{idx}"
|
|
19
|
+
asciicast_src = element.attrs["src"]
|
|
21
20
|
|
|
22
21
|
# asciinema options, see https://docs.asciinema.org/manual/player/options/
|
|
23
22
|
options = {"fit": "width", "preload": True}
|
|
24
23
|
|
|
25
24
|
for key, value in element.attrs.items():
|
|
26
|
-
|
|
27
25
|
if key in ["src"]:
|
|
28
26
|
continue
|
|
29
27
|
|
|
@@ -38,7 +36,8 @@ def on_post_page(output, page, config):
|
|
|
38
36
|
element.replace_with(div_tag)
|
|
39
37
|
asciicasts.append(
|
|
40
38
|
f'asciinema_create_player("{asciicast_src}", '
|
|
41
|
-
f'document.getElementById("{asciicast_id}"), {json.dumps(options)});'
|
|
39
|
+
f'document.getElementById("{asciicast_id}"), {json.dumps(options)});'
|
|
40
|
+
)
|
|
42
41
|
|
|
43
42
|
asciicast_script = soup.new_tag("script")
|
|
44
43
|
asciicast_script.append("\n".join(asciicasts))
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import posixpath
|
|
4
3
|
import re
|
|
5
4
|
|
|
6
5
|
from mkdocs.config.defaults import MkDocsConfig
|
|
@@ -14,9 +13,7 @@ from re import Match
|
|
|
14
13
|
# -----------------------------------------------------------------------------
|
|
15
14
|
|
|
16
15
|
|
|
17
|
-
def on_page_markdown(
|
|
18
|
-
markdown: str, *, page: Page, config: MkDocsConfig, files: Files
|
|
19
|
-
):
|
|
16
|
+
def on_page_markdown(markdown: str, *, page: Page, config: MkDocsConfig, files: Files):
|
|
20
17
|
# Replace callback
|
|
21
18
|
def replace(match: Match):
|
|
22
19
|
type, args = match.groups()
|
|
@@ -30,10 +27,7 @@ def on_page_markdown(
|
|
|
30
27
|
raise RuntimeError(f"Unknown shortcode: {type}")
|
|
31
28
|
|
|
32
29
|
# Find and replace all external asset URLs in current page
|
|
33
|
-
return re.sub(
|
|
34
|
-
r"<!-- md:(\w+)(.*?) -->",
|
|
35
|
-
replace, markdown, flags=re.I | re.M
|
|
36
|
-
)
|
|
30
|
+
return re.sub(r"<!-- md:(\w+)(.*?) -->", replace, markdown, flags=re.I | re.M)
|
|
37
31
|
|
|
38
32
|
|
|
39
33
|
# Create badge for version
|
|
@@ -56,9 +50,11 @@ def _badge_for_provider(provider: str, page: Page, files: Files):
|
|
|
56
50
|
def _badge(icon: str, text: str = "", tooltip: str = "", type: str = ""):
|
|
57
51
|
classes = f"mdx-badge mdx-badge--{type}" if type else "mdx-badge"
|
|
58
52
|
text = f"{text}{{ data-preview='' }}" if text.endswith(")") else text
|
|
59
|
-
return "".join(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
return "".join(
|
|
54
|
+
[
|
|
55
|
+
f'<span class="{classes}" title="{tooltip}">',
|
|
56
|
+
*([f'<span class="mdx-badge__icon">:{icon}:</span>'] if icon else []),
|
|
57
|
+
*([f'<span class="mdx-badge__text">{text}</span>'] if text else []),
|
|
58
|
+
"</span>",
|
|
59
|
+
]
|
|
60
|
+
)
|
|
@@ -0,0 +1,184 @@
|
|
|
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 (
|
|
23
|
+
"--provider" in sys.argv or "-p" in sys.argv
|
|
24
|
+
):
|
|
25
|
+
real_args = list(filter(lambda x: x not in ["--help", "-h"], sys.argv))
|
|
26
|
+
args, unknown_args = parser.parse_known_args(real_args[1:])
|
|
27
|
+
unknown_args.append("--help")
|
|
28
|
+
else:
|
|
29
|
+
args, unknown_args = parser.parse_known_args()
|
|
30
|
+
|
|
31
|
+
__args = args
|
|
32
|
+
__unknown_args = unknown_args
|
|
33
|
+
|
|
34
|
+
return args, unknown_args
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def setup_parser():
|
|
38
|
+
parser = argparse.ArgumentParser(
|
|
39
|
+
description="An awesome universal deployment tool for k8s",
|
|
40
|
+
usage=colors.bold(
|
|
41
|
+
f"adeploy -p {colors.blue('provider')} {colors.gray('[optional args ...]')} "
|
|
42
|
+
f"{colors.blue('build-step')} {colors.gray('[optional build args ...]')} "
|
|
43
|
+
f"{colors.blue('src_dir')} [{colors.blue('src_dir')} ...]"
|
|
44
|
+
),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
parser.add_argument("-l", "--log", dest="logfile", help="Path to logfile")
|
|
48
|
+
|
|
49
|
+
parser.add_argument("-d", "--debug", action="store_true")
|
|
50
|
+
|
|
51
|
+
parser.add_argument("-s", "--skip-colors", dest="skip_colors", action="store_true")
|
|
52
|
+
|
|
53
|
+
parser.add_argument("-f", "--force", dest="force", action="store_true")
|
|
54
|
+
|
|
55
|
+
parser.add_argument(
|
|
56
|
+
"-p",
|
|
57
|
+
"--provider",
|
|
58
|
+
dest="provider",
|
|
59
|
+
help="The provider to use, type --providers to get a list of supported providers.",
|
|
60
|
+
required="--providers" not in sys.argv and "--version" not in sys.argv,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
parser.add_argument(
|
|
64
|
+
"--providers",
|
|
65
|
+
dest="list_providers",
|
|
66
|
+
action="store_true",
|
|
67
|
+
help="A list of supported providers",
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
parser.add_argument(
|
|
71
|
+
"-n",
|
|
72
|
+
"--name",
|
|
73
|
+
dest="deployment_name",
|
|
74
|
+
default=None,
|
|
75
|
+
help="Specify a deployment name. This will overwrite deployment name derived from repo dir",
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
parser.add_argument(
|
|
79
|
+
"--adeploy-dir",
|
|
80
|
+
dest="adeploy_dir",
|
|
81
|
+
help="Configuration directory for adeploy",
|
|
82
|
+
default=Path.home().joinpath(".adeploy"),
|
|
83
|
+
metavar="adeploy_dir",
|
|
84
|
+
type=Path,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
parser.add_argument(
|
|
88
|
+
"--build-dir",
|
|
89
|
+
dest="build_dir",
|
|
90
|
+
help="Build directory for output",
|
|
91
|
+
default="./build",
|
|
92
|
+
metavar="build_dir",
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
parser.add_argument(
|
|
96
|
+
"--defaults",
|
|
97
|
+
action="append",
|
|
98
|
+
default=["defaults.yml"],
|
|
99
|
+
help="YML files or directories containing <deployment_name>.yml with default variables. "
|
|
100
|
+
"Relative to source dirs. Processed in order. Later files update previous ones",
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
parser.add_argument(
|
|
104
|
+
"--namespaces",
|
|
105
|
+
dest="namespaces_dir",
|
|
106
|
+
default="namespaces",
|
|
107
|
+
help="Directory containing namespaces and variables for deployments",
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
parser.add_argument(
|
|
111
|
+
"--recreate-secrets",
|
|
112
|
+
dest="recreate_secrets",
|
|
113
|
+
action="store_true",
|
|
114
|
+
help="Force to re-create secrets. This might invoke a password store to retrieve secrets.",
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
parser.add_argument(
|
|
118
|
+
"--filter-namespace",
|
|
119
|
+
dest="filters_namespace",
|
|
120
|
+
nargs="+",
|
|
121
|
+
action="append",
|
|
122
|
+
help="Only include specified namespace. Argument can be specified multiple times.",
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
parser.add_argument(
|
|
126
|
+
"--filter-release",
|
|
127
|
+
dest="filters_release",
|
|
128
|
+
nargs="+",
|
|
129
|
+
action="append",
|
|
130
|
+
help='Only include specified deployment release i.e. "prod", "testing". '
|
|
131
|
+
"Argument can be specified multiple times.",
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
parser.add_argument(
|
|
135
|
+
"--show-configs",
|
|
136
|
+
dest="show_configs",
|
|
137
|
+
action="store_true",
|
|
138
|
+
default=False,
|
|
139
|
+
help="Print out rendered namespace configurations and quit.",
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
parser.add_argument(
|
|
143
|
+
"--gopass-repo",
|
|
144
|
+
dest="gopass_repo",
|
|
145
|
+
nargs="+",
|
|
146
|
+
action="append",
|
|
147
|
+
help="Gopass repo names, where the awesome secrets are stored. This argument can be specified "
|
|
148
|
+
"multiple times for multiple Gpoass repos. This params can also be specified by the env "
|
|
149
|
+
"var ADEPLOY_GOPASS_REPOS where comma separated list of Gopass repo names is expected. "
|
|
150
|
+
"If args are specified, these take precedence and the env var is ignored.",
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
parser.add_argument("--version", action="store_true", help="Print version and exit")
|
|
154
|
+
|
|
155
|
+
subparsers = parser.add_subparsers(
|
|
156
|
+
title="Available build steps", metavar=colors.bold("build-steps")
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
for module, class_name in get_submodules(steps):
|
|
160
|
+
module_name = module.__name__
|
|
161
|
+
subparser = subparsers.add_parser(
|
|
162
|
+
module_name,
|
|
163
|
+
help=f'Call module "{module_name}", '
|
|
164
|
+
f"type: {sys.argv[0]} {module_name} --help for more options",
|
|
165
|
+
)
|
|
166
|
+
subparser.add_argument(
|
|
167
|
+
"src_dirs",
|
|
168
|
+
help="Directory containing deployment sources",
|
|
169
|
+
nargs="*",
|
|
170
|
+
default=".",
|
|
171
|
+
metavar="src_dir",
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
if module_name == "config":
|
|
175
|
+
subparser.add_argument(
|
|
176
|
+
"-o,--out",
|
|
177
|
+
dest="config_out",
|
|
178
|
+
default="",
|
|
179
|
+
help="Filename to store the rendered namespace configurations as JSON.",
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
subparser.add_argument(f"--{module_name}", default=True, help=argparse.SUPPRESS)
|
|
183
|
+
|
|
184
|
+
return parser
|
|
@@ -9,28 +9,28 @@ def skip_colors(skip=True):
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
def blue(text):
|
|
12
|
-
return f
|
|
12
|
+
return f"{Fore.BLUE}{text}{Fore.RESET}" if not _skip_colors else text
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
def green(text):
|
|
16
|
-
return f
|
|
16
|
+
return f"{Fore.GREEN}{text}{Fore.RESET}" if not _skip_colors else text
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
def red(text):
|
|
20
|
-
return f
|
|
20
|
+
return f"{Fore.RED}{text}{Fore.RESET}" if not _skip_colors else text
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
def orange(text):
|
|
24
|
-
return f
|
|
24
|
+
return f"{Fore.YELLOW}{text}{Fore.RESET}" if not _skip_colors else text
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def gray(text):
|
|
28
28
|
# Fore.Gray is not readable in some terminals.
|
|
29
|
-
return f
|
|
29
|
+
return f"{Fore.RESET}{text}" if not _skip_colors else text
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
def bold(text):
|
|
33
|
-
return f
|
|
33
|
+
return f"{Style.BRIGHT}{text}{Style.NORMAL}" if not _skip_colors else text
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def red_bold(text):
|
|
@@ -46,4 +46,4 @@ def blue_bold(text):
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
def orange_bold(text):
|
|
49
|
-
return bold(orange(text))
|
|
49
|
+
return bold(orange(text))
|
|
@@ -29,40 +29,55 @@ class Deployment:
|
|
|
29
29
|
|
|
30
30
|
self.build_dir = Path(build_dir)
|
|
31
31
|
|
|
32
|
-
self.manifests_dir =
|
|
33
|
-
|
|
34
|
-
.joinpath(self.
|
|
32
|
+
self.manifests_dir = (
|
|
33
|
+
Path(build_dir)
|
|
34
|
+
.joinpath(self.namespace)
|
|
35
|
+
.joinpath(self.name)
|
|
35
36
|
.joinpath(self.release)
|
|
37
|
+
)
|
|
36
38
|
|
|
37
|
-
self.last_cluster_file =
|
|
38
|
-
|
|
39
|
-
.joinpath(
|
|
40
|
-
.joinpath(self.
|
|
39
|
+
self.last_cluster_file = (
|
|
40
|
+
Path(build_dir)
|
|
41
|
+
.joinpath(".last_cluster")
|
|
42
|
+
.joinpath(self.namespace)
|
|
43
|
+
.joinpath(self.name)
|
|
41
44
|
.joinpath(self.release)
|
|
45
|
+
)
|
|
42
46
|
|
|
43
47
|
def __repr__(self):
|
|
44
|
-
return f
|
|
48
|
+
return f"{self.namespace}/{self.name}-{self.release}"
|
|
45
49
|
|
|
46
50
|
def skipped(self, args):
|
|
47
|
-
filters_namespace =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
filters_namespace = (
|
|
52
|
+
[t[0] for t in args.filters_namespace] if args.filters_namespace else None
|
|
53
|
+
)
|
|
54
|
+
filters_release = (
|
|
55
|
+
[t[0] for t in args.filters_release] if args.filters_release else None
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
if (filters_namespace and self.namespace not in filters_namespace) or (
|
|
59
|
+
filters_release
|
|
60
|
+
and self.name not in filters_release
|
|
61
|
+
and self.release not in filters_release
|
|
62
|
+
):
|
|
52
63
|
return True
|
|
53
64
|
|
|
54
65
|
return False
|
|
55
66
|
|
|
56
|
-
def load_config(
|
|
67
|
+
def load_config(
|
|
68
|
+
self, config_path: Path, defaults_files: list = None, log: Logger = None
|
|
69
|
+
):
|
|
57
70
|
# We're not yet rendering.
|
|
58
71
|
# Reset list of known secrets in order to allow multiple deployments to use the same defaults file
|
|
59
72
|
SecretsProvider.reset_created_secrets_list()
|
|
60
73
|
|
|
61
74
|
if log:
|
|
62
75
|
if not defaults_files:
|
|
63
|
-
log.warning(
|
|
76
|
+
log.warning("Not using defaults, continue ...")
|
|
64
77
|
else:
|
|
65
|
-
log.info(
|
|
78
|
+
log.info(
|
|
79
|
+
f"Using defaults from {colors.bold(', '.join([str(f) for f in defaults_files]))} ..."
|
|
80
|
+
)
|
|
66
81
|
|
|
67
82
|
self.config = {}
|
|
68
83
|
|
|
@@ -70,48 +85,59 @@ class Deployment:
|
|
|
70
85
|
return self.config
|
|
71
86
|
|
|
72
87
|
for defaults_file in defaults_files:
|
|
73
|
-
|
|
74
88
|
try:
|
|
75
|
-
|
|
76
89
|
# Compile defaults with default Jinja renderer i.e. to provide globals and filters
|
|
77
|
-
defaults = get_defaults(
|
|
78
|
-
|
|
79
|
-
|
|
90
|
+
defaults = get_defaults(
|
|
91
|
+
defaults_file,
|
|
92
|
+
deployment=self,
|
|
93
|
+
log=log,
|
|
94
|
+
template_values=self.get_template_values(),
|
|
95
|
+
)
|
|
80
96
|
if defaults is not None:
|
|
81
97
|
self.config.update(defaults)
|
|
82
98
|
|
|
83
99
|
except ParserError as e:
|
|
84
|
-
raise Error(
|
|
100
|
+
raise Error(
|
|
101
|
+
f'Unexpected error while parsing YAML "{colors.bold(defaults_file)}": {e}'
|
|
102
|
+
)
|
|
85
103
|
|
|
86
104
|
try:
|
|
87
105
|
# Compile config with default Jinja renderer i.e. to provide globals and filters
|
|
88
106
|
env = jinja_env.create([config_path.parent], deployment=self, log=log)
|
|
89
|
-
template = env.get_template(config_path.name).render(
|
|
90
|
-
|
|
107
|
+
template = env.get_template(config_path.name).render(
|
|
108
|
+
defaults=self.config, **self.get_template_values()
|
|
109
|
+
)
|
|
110
|
+
self.config = dict_update_recursive(
|
|
111
|
+
self.config, yaml.load(template, Loader=yaml.FullLoader)
|
|
112
|
+
)
|
|
91
113
|
|
|
92
114
|
except ScannerError as e:
|
|
93
|
-
raise Error(
|
|
94
|
-
|
|
115
|
+
raise Error(
|
|
116
|
+
f'Unexpected error while scanning YAML "{colors.bold(config_path)}": {e}\n'
|
|
117
|
+
f"{colors.bold('Template')}:\n{template}"
|
|
118
|
+
)
|
|
95
119
|
|
|
96
120
|
except ParserError as e:
|
|
97
|
-
raise Error(
|
|
98
|
-
|
|
121
|
+
raise Error(
|
|
122
|
+
f'Unexpected error while parsing YAML "{colors.bold(config_path)}": {e}\n'
|
|
123
|
+
f"{colors.bold('Template')}:\n{template}"
|
|
124
|
+
)
|
|
99
125
|
|
|
100
126
|
return self.config
|
|
101
127
|
|
|
102
128
|
def get_template_values(self):
|
|
103
|
-
|
|
104
129
|
values = copy.deepcopy(self.config)
|
|
105
|
-
values.update(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
130
|
+
values.update(
|
|
131
|
+
{
|
|
132
|
+
"name": self.name.replace(".", "-"),
|
|
133
|
+
"release": self.release.replace(".", "-"),
|
|
134
|
+
"namespace": self.namespace,
|
|
135
|
+
"deployment": jinja_dict.JinjaDict(self.config),
|
|
136
|
+
# Some legacy variables
|
|
137
|
+
"node_selector": self.config.get("node", {}),
|
|
138
|
+
"default_versions": self.config.get("versions", {}),
|
|
139
|
+
}
|
|
140
|
+
)
|
|
115
141
|
|
|
116
142
|
return jinja_dict.JinjaDict(values)
|
|
117
143
|
|
|
@@ -124,11 +150,10 @@ class Deployment:
|
|
|
124
150
|
def set_last_cluster(self, cluster, force=False):
|
|
125
151
|
if force or not self.last_cluster_file.exists():
|
|
126
152
|
self.last_cluster_file.parent.mkdir(parents=True, exist_ok=True)
|
|
127
|
-
with open(self.last_cluster_file,
|
|
153
|
+
with open(self.last_cluster_file, "w") as f:
|
|
128
154
|
f.write(cluster)
|
|
129
155
|
|
|
130
156
|
def clean_build_dir(self):
|
|
131
|
-
|
|
132
157
|
dirs_to_remove = [
|
|
133
158
|
self.manifests_dir, # Contains the rendered manifests
|
|
134
159
|
self.build_dir / self.name, # Contains secrets
|
|
@@ -1,31 +1,38 @@
|
|
|
1
1
|
class Error(Exception):
|
|
2
2
|
"""Base class for exceptions in this module."""
|
|
3
|
+
|
|
3
4
|
pass
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
class InputError(Error):
|
|
7
8
|
"""Exception raised for errors in the user input."""
|
|
9
|
+
|
|
8
10
|
pass
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
class RenderError(Error):
|
|
12
|
-
"""
|
|
14
|
+
"""Exception raised for errors in the renderer."""
|
|
15
|
+
|
|
13
16
|
pass
|
|
14
17
|
|
|
15
18
|
|
|
16
19
|
class TestError(Error):
|
|
17
|
-
"""
|
|
20
|
+
"""Exception raised for errors in the tester."""
|
|
21
|
+
|
|
18
22
|
pass
|
|
19
23
|
|
|
20
24
|
|
|
21
25
|
class DeployError(Error):
|
|
22
|
-
"""
|
|
26
|
+
"""Exception raised for errors in the tester."""
|
|
27
|
+
|
|
23
28
|
pass
|
|
24
29
|
|
|
25
30
|
|
|
26
31
|
class WrongClusterError(Error):
|
|
27
|
-
"""
|
|
32
|
+
"""Exception raised if wrong cluster is targeted."""
|
|
33
|
+
|
|
28
34
|
pass
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
|
|
37
|
+
if __name__ == "__main__":
|
|
31
38
|
pass
|
|
@@ -16,10 +16,14 @@ import adeploy.common.jinja.env as jinja_env
|
|
|
16
16
|
|
|
17
17
|
def get_submodules(pkg):
|
|
18
18
|
modules = []
|
|
19
|
-
for module_finder, name, ispkg in pkgutil.iter_modules(
|
|
19
|
+
for module_finder, name, ispkg in pkgutil.iter_modules(
|
|
20
|
+
[os.path.dirname(pkg.__file__)]
|
|
21
|
+
):
|
|
20
22
|
module_spec = module_finder.find_spec(name)
|
|
21
23
|
module = module_spec.loader.load_module()
|
|
22
|
-
class_name = list(filter(lambda m: module.__name__ == m.lower(), dir(module)))[
|
|
24
|
+
class_name = list(filter(lambda m: module.__name__ == m.lower(), dir(module)))[
|
|
25
|
+
0
|
|
26
|
+
]
|
|
23
27
|
modules.append((module, class_name))
|
|
24
28
|
|
|
25
29
|
return modules
|
|
@@ -31,34 +35,46 @@ def get_provider(name):
|
|
|
31
35
|
|
|
32
36
|
def get_providers() -> dict:
|
|
33
37
|
found = {}
|
|
34
|
-
for module_finder, name, ispkg in pkgutil.iter_modules(
|
|
38
|
+
for module_finder, name, ispkg in pkgutil.iter_modules(
|
|
39
|
+
[os.path.dirname(providers.__file__)]
|
|
40
|
+
):
|
|
35
41
|
if ispkg:
|
|
36
42
|
module_spec = module_finder.find_spec(name)
|
|
37
43
|
module = module_spec.loader.load_module()
|
|
38
|
-
found[name] = namedtuple(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
found[name] = namedtuple("Provider", "renderer tester deployer watcher")(
|
|
45
|
+
renderer=getattr(module, "Renderer"),
|
|
46
|
+
tester=getattr(module, "Tester"),
|
|
47
|
+
deployer=getattr(module, "Deployer"),
|
|
48
|
+
watcher=getattr(module, "Watcher"),
|
|
49
|
+
)
|
|
44
50
|
return found
|
|
45
51
|
|
|
46
52
|
|
|
47
|
-
def get_defaults(
|
|
53
|
+
def get_defaults(
|
|
54
|
+
defaults_files: PosixPath | list[PosixPath],
|
|
55
|
+
deployment=None,
|
|
56
|
+
log=None,
|
|
57
|
+
template_values=None,
|
|
58
|
+
):
|
|
48
59
|
if type(defaults_files) is PosixPath:
|
|
49
60
|
files = [defaults_files]
|
|
50
61
|
else:
|
|
51
62
|
files = defaults_files
|
|
52
63
|
defaults = {}
|
|
53
64
|
for file in files:
|
|
54
|
-
logging.debug(f
|
|
65
|
+
logging.debug(f"Loading defaults from {file}")
|
|
55
66
|
env = jinja_env.create([file.parent], deployment=deployment, log=log)
|
|
56
67
|
# Make best to load defaults
|
|
57
68
|
template_values_default = {
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
"name": deployment.name if deployment else "undefined",
|
|
70
|
+
"namespace": deployment.namespace if deployment else "undefined",
|
|
60
71
|
}
|
|
61
|
-
values = yaml.load(
|
|
72
|
+
values = yaml.load(
|
|
73
|
+
env.get_template(file.name).render(
|
|
74
|
+
template_values if template_values else template_values_default
|
|
75
|
+
),
|
|
76
|
+
Loader=yaml.FullLoader,
|
|
77
|
+
)
|
|
62
78
|
defaults.update(values)
|
|
63
79
|
return defaults
|
|
64
80
|
|
|
@@ -66,7 +82,7 @@ def get_defaults(defaults_files: PosixPath | list[PosixPath], deployment=None, l
|
|
|
66
82
|
def run_command(log, cmd) -> subprocess.CompletedProcess:
|
|
67
83
|
# Convert possible Paths to strings
|
|
68
84
|
cmd = [str(c) for c in cmd]
|
|
69
|
-
log.debug(f
|
|
85
|
+
log.debug(f"Executing command {colors.bold(' '.join(cmd))}")
|
|
70
86
|
result = subprocess.run(cmd, capture_output=True, text=True)
|
|
71
87
|
result.check_returncode()
|
|
72
88
|
return result
|
|
@@ -81,8 +97,8 @@ def dict_update_recursive(d: dict, u: dict) -> dict:
|
|
|
81
97
|
sub = d[k]
|
|
82
98
|
d[k] = dict_update_recursive(sub, v)
|
|
83
99
|
# We don't merge lists! List will be overwritten completely.
|
|
84
|
-
#elif isinstance(v, list):
|
|
100
|
+
# elif isinstance(v, list):
|
|
85
101
|
# d[k] = (d[k] if k in d else []) + v
|
|
86
102
|
else:
|
|
87
103
|
d[k] = v
|
|
88
|
-
return d
|
|
104
|
+
return d
|