dbt-platform-helper 10.6.1__tar.gz → 10.7.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.
Potentially problematic release.
This version of dbt-platform-helper might be problematic. Click here for more details.
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/PKG-INFO +1 -1
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/COMMANDS.md +44 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/conduit.py +1 -1
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/copilot.py +2 -2
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/environment.py +1 -1
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/generate.py +0 -2
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/pipeline.py +1 -1
- dbt_platform_helper-10.7.1/dbt_platform_helper/commands/version.py +38 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/constants.py +1 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/codebase/overrides/buildspec.deploy.yml +2 -9
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/svc/overrides/cfn.patches.yml +12 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/files.py +16 -14
- dbt_platform_helper-10.7.1/dbt_platform_helper/utils/platform_config.py +19 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/validation.py +65 -25
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/versioning.py +89 -21
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/platform_helper.py +2 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/pyproject.toml +1 -1
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/LICENSE +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/README.md +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/__init__.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/addon-plans.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/addons-template-map.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/__init__.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/application.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/check_cloudformation.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/codebase.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/config.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/database.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/dns.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/notify.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/secrets.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/custom_resources/__init__.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/custom_resources/s3_object.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/default-extensions.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/exceptions.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/jinja2_tags.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/.copilot/config.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/.copilot/image_build_run.sh +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/.copilot/phases/build.sh +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/.copilot/phases/install.sh +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/.copilot/phases/post_build.sh +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/.copilot/phases/pre_build.sh +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/COMMANDS.md.jinja +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addon-instructions.txt +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addons/README.md +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addons/env/addons.parameters.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addons/env/aurora-postgres.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addons/env/monitoring.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addons/env/opensearch.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addons/env/rds-postgres.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addons/env/redis-cluster.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addons/env/s3.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addons/env/vpc.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addons/svc/appconfig-ipfilter.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addons/svc/prometheus-policy.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addons/svc/s3-policy.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/addons/svc/subscription-filter.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/ci-codebuild-role-policy.json +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/create-codebuild-role.json +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/custom-codebuild-role-policy.json +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/env/manifest.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/env/overrides/.gitignore +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/env/overrides/README.md +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/env/overrides/bin/override.ts +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/env/overrides/cdk.json +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/env/overrides/log_resource_policy.json +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/env/overrides/package-lock.json +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/env/overrides/package.json +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/env/overrides/stack.ts +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/env/overrides/tsconfig.json +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/env/terraform-overrides/cfn.patches.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/environments/main.tf +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/codebase/manifest.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/codebase/overrides/.gitignore +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/codebase/overrides/bin/override.ts +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/codebase/overrides/buildspec.image.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/codebase/overrides/cdk.json +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/codebase/overrides/package-lock.json +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/codebase/overrides/package.json +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/codebase/overrides/stack.ts +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/codebase/overrides/tsconfig.json +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/codebase/overrides/types.ts +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/environments/buildspec.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/environments/manifest.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/pipelines/environments/overrides/cfn.patches.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/svc/maintenance_pages/default.html +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/svc/maintenance_pages/dmas-migration.html +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/svc/maintenance_pages/migration.html +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/svc/manifest-backend.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/templates/svc/manifest-public.yml +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/__init__.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/application.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/arn_parser.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/aws.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/click.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/cloudformation.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/cloudfoundry.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/git.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/manifests.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/messages.py +0 -0
- {dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/template.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dbt-platform-helper
|
|
3
|
-
Version: 10.
|
|
3
|
+
Version: 10.7.1
|
|
4
4
|
Summary: Set of tools to help transfer applications/services from GOV.UK PaaS to DBT PaaS augmenting AWS Copilot.
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Department for Business and Trade Platform Team
|
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
- [platform-helper notify add-comment](#platform-helper-notify-add-comment)
|
|
42
42
|
- [platform-helper database](#platform-helper-database)
|
|
43
43
|
- [platform-helper database copy](#platform-helper-database-copy)
|
|
44
|
+
- [platform-helper version](#platform-helper-version)
|
|
45
|
+
- [platform-helper version get-platform-helper-for-project](#platform-helper-version-get-platform-helper-for-project)
|
|
44
46
|
|
|
45
47
|
# platform-helper
|
|
46
48
|
|
|
@@ -73,6 +75,7 @@ platform-helper <command> [--version]
|
|
|
73
75
|
- [`notify` ↪](#platform-helper-notify)
|
|
74
76
|
- [`pipeline` ↪](#platform-helper-pipeline)
|
|
75
77
|
- [`secrets` ↪](#platform-helper-secrets)
|
|
78
|
+
- [`version` ↪](#platform-helper-version)
|
|
76
79
|
|
|
77
80
|
# platform-helper application
|
|
78
81
|
|
|
@@ -994,3 +997,44 @@ platform-helper database copy <source_db> <target_db>
|
|
|
994
997
|
|
|
995
998
|
- `--help <boolean>` _Defaults to False._
|
|
996
999
|
- Show this message and exit.
|
|
1000
|
+
|
|
1001
|
+
# platform-helper version
|
|
1002
|
+
|
|
1003
|
+
[↩ Parent](#platform-helper)
|
|
1004
|
+
|
|
1005
|
+
Contains subcommands for getting version information about the current
|
|
1006
|
+
project.
|
|
1007
|
+
|
|
1008
|
+
## Usage
|
|
1009
|
+
|
|
1010
|
+
```
|
|
1011
|
+
platform-helper version get-platform-helper-for-project
|
|
1012
|
+
```
|
|
1013
|
+
|
|
1014
|
+
## Options
|
|
1015
|
+
|
|
1016
|
+
- `--help <boolean>` _Defaults to False._
|
|
1017
|
+
- Show this message and exit.
|
|
1018
|
+
|
|
1019
|
+
## Commands
|
|
1020
|
+
|
|
1021
|
+
- [`get-platform-helper-for-project` ↪](#platform-helper-version-get-platform-helper-for-project)
|
|
1022
|
+
|
|
1023
|
+
# platform-helper version get-platform-helper-for-project
|
|
1024
|
+
|
|
1025
|
+
[↩ Parent](#platform-helper-version)
|
|
1026
|
+
|
|
1027
|
+
Print the version of platform-tools required by the current project
|
|
1028
|
+
|
|
1029
|
+
## Usage
|
|
1030
|
+
|
|
1031
|
+
```
|
|
1032
|
+
platform-helper version get-platform-helper-for-project [--pipeline (main|test|prod-main)]
|
|
1033
|
+
```
|
|
1034
|
+
|
|
1035
|
+
## Options
|
|
1036
|
+
|
|
1037
|
+
- `--pipeline <choice>`
|
|
1038
|
+
- Take into account platform-tools version overrides in the specified pipeline
|
|
1039
|
+
- `--help <boolean>` _Defaults to False._
|
|
1040
|
+
- Show this message and exit.
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/conduit.py
RENAMED
|
@@ -12,7 +12,7 @@ from dbt_platform_helper.utils.application import Application
|
|
|
12
12
|
from dbt_platform_helper.utils.application import load_application
|
|
13
13
|
from dbt_platform_helper.utils.aws import update_postgres_parameter_with_master_secret
|
|
14
14
|
from dbt_platform_helper.utils.click import ClickDocOptCommand
|
|
15
|
-
from dbt_platform_helper.utils.
|
|
15
|
+
from dbt_platform_helper.utils.platform_config import is_terraform_project
|
|
16
16
|
from dbt_platform_helper.utils.versioning import (
|
|
17
17
|
check_platform_helper_version_needs_update,
|
|
18
18
|
)
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/copilot.py
RENAMED
|
@@ -10,14 +10,14 @@ from pathlib import PosixPath
|
|
|
10
10
|
import click
|
|
11
11
|
import yaml
|
|
12
12
|
|
|
13
|
+
from dbt_platform_helper.constants import PLATFORM_CONFIG_FILE
|
|
13
14
|
from dbt_platform_helper.utils.application import get_application_name
|
|
14
15
|
from dbt_platform_helper.utils.application import load_application
|
|
15
16
|
from dbt_platform_helper.utils.aws import get_aws_session_or_abort
|
|
16
17
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
17
|
-
from dbt_platform_helper.utils.files import PLATFORM_CONFIG_FILE
|
|
18
18
|
from dbt_platform_helper.utils.files import generate_override_files
|
|
19
|
-
from dbt_platform_helper.utils.files import is_terraform_project
|
|
20
19
|
from dbt_platform_helper.utils.files import mkfile
|
|
20
|
+
from dbt_platform_helper.utils.platform_config import is_terraform_project
|
|
21
21
|
from dbt_platform_helper.utils.template import camel_case
|
|
22
22
|
from dbt_platform_helper.utils.template import setup_templates
|
|
23
23
|
from dbt_platform_helper.utils.validation import config_file_check
|
|
@@ -17,8 +17,8 @@ from dbt_platform_helper.utils.application import load_application
|
|
|
17
17
|
from dbt_platform_helper.utils.aws import get_aws_session_or_abort
|
|
18
18
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
19
19
|
from dbt_platform_helper.utils.files import apply_environment_defaults
|
|
20
|
-
from dbt_platform_helper.utils.files import is_terraform_project
|
|
21
20
|
from dbt_platform_helper.utils.files import mkfile
|
|
21
|
+
from dbt_platform_helper.utils.platform_config import is_terraform_project
|
|
22
22
|
from dbt_platform_helper.utils.template import setup_templates
|
|
23
23
|
from dbt_platform_helper.utils.validation import load_and_validate_platform_config
|
|
24
24
|
from dbt_platform_helper.utils.versioning import (
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/generate.py
RENAMED
|
@@ -5,7 +5,6 @@ from dbt_platform_helper.commands.copilot import make_addons
|
|
|
5
5
|
from dbt_platform_helper.commands.pipeline import generate as pipeline_generate
|
|
6
6
|
from dbt_platform_helper.utils.click import ClickDocOptCommand
|
|
7
7
|
from dbt_platform_helper.utils.versioning import check_platform_helper_version_mismatch
|
|
8
|
-
from dbt_platform_helper.utils.versioning import generate_platform_helper_version_file
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
@click.command(cls=ClickDocOptCommand)
|
|
@@ -18,7 +17,6 @@ def generate(ctx: click.Context):
|
|
|
18
17
|
Wraps pipeline generate and make-addons.
|
|
19
18
|
"""
|
|
20
19
|
|
|
21
|
-
generate_platform_helper_version_file()
|
|
22
20
|
check_platform_helper_version_mismatch()
|
|
23
21
|
ctx.invoke(pipeline_generate)
|
|
24
22
|
ctx.invoke(make_addons)
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/pipeline.py
RENAMED
|
@@ -12,10 +12,10 @@ from dbt_platform_helper.utils.aws import get_public_repository_arn
|
|
|
12
12
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
13
13
|
from dbt_platform_helper.utils.files import apply_environment_defaults
|
|
14
14
|
from dbt_platform_helper.utils.files import generate_override_files_from_template
|
|
15
|
-
from dbt_platform_helper.utils.files import is_terraform_project
|
|
16
15
|
from dbt_platform_helper.utils.files import mkfile
|
|
17
16
|
from dbt_platform_helper.utils.git import git_remote
|
|
18
17
|
from dbt_platform_helper.utils.messages import abort_with_error
|
|
18
|
+
from dbt_platform_helper.utils.platform_config import is_terraform_project
|
|
19
19
|
from dbt_platform_helper.utils.template import setup_templates
|
|
20
20
|
from dbt_platform_helper.utils.validation import load_and_validate_platform_config
|
|
21
21
|
from dbt_platform_helper.utils.versioning import (
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import click
|
|
2
|
+
|
|
3
|
+
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
4
|
+
from dbt_platform_helper.utils.platform_config import get_environment_pipeline_names
|
|
5
|
+
from dbt_platform_helper.utils.versioning import (
|
|
6
|
+
check_platform_helper_version_needs_update,
|
|
7
|
+
)
|
|
8
|
+
from dbt_platform_helper.utils.versioning import get_required_platform_helper_version
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@click.group(chain=True, cls=ClickDocOptGroup)
|
|
12
|
+
def version():
|
|
13
|
+
"""Contains subcommands for getting version information about the current
|
|
14
|
+
project."""
|
|
15
|
+
check_platform_helper_version_needs_update()
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@version.command(help="Print the version of platform-tools required by the current project")
|
|
19
|
+
@click.option(
|
|
20
|
+
"--pipeline",
|
|
21
|
+
required=False,
|
|
22
|
+
type=click.Choice(get_environment_pipeline_names()),
|
|
23
|
+
help="Take into account platform-tools version overrides in the specified pipeline",
|
|
24
|
+
)
|
|
25
|
+
def get_platform_helper_for_project(pipeline):
|
|
26
|
+
"""
|
|
27
|
+
Version precedence is in this order:
|
|
28
|
+
- if the --pipeline option is supplied, the version in 'platform-config.yml' in:
|
|
29
|
+
environment_pipelines:
|
|
30
|
+
<pipeline>:
|
|
31
|
+
...
|
|
32
|
+
versions:
|
|
33
|
+
platform-helper
|
|
34
|
+
- The version from default_versions/platform-helper in 'platform-config.yml'
|
|
35
|
+
- Fall back on the version in the deprecated '.platform-helper-version' file
|
|
36
|
+
"""
|
|
37
|
+
required_version = get_required_platform_helper_version(pipeline)
|
|
38
|
+
click.secho(required_version)
|
|
@@ -10,15 +10,8 @@ env:
|
|
|
10
10
|
phases:
|
|
11
11
|
build:
|
|
12
12
|
commands:
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
echo "Environments are - ${environments}"
|
|
16
|
-
if echo ",${environments}," | grep -q ",${COPILOT_ENVIRONMENT},"; then
|
|
17
|
-
echo "Copilot environment is ${COPILOT_ENVIRONMENT}"
|
|
18
|
-
/work/cli deploy --send-notifications
|
|
19
|
-
else
|
|
20
|
-
exit 1
|
|
21
|
-
fi
|
|
13
|
+
- echo "Copilot environment is ${COPILOT_ENVIRONMENT}"
|
|
14
|
+
- /work/cli deploy --send-notifications
|
|
22
15
|
|
|
23
16
|
post_build:
|
|
24
17
|
commands:
|
|
@@ -12,3 +12,15 @@
|
|
|
12
12
|
path: /Resources/TaskDefinition/Properties/Volumes
|
|
13
13
|
value:
|
|
14
14
|
- Name: temporary-fs
|
|
15
|
+
|
|
16
|
+
- op: add
|
|
17
|
+
path: /Resources/ExecutionRole/Properties/Policies/0/PolicyDocument/Statement/4
|
|
18
|
+
value:
|
|
19
|
+
Effect: 'Allow'
|
|
20
|
+
Action:
|
|
21
|
+
- 'ssm:GetParameters'
|
|
22
|
+
Resource:
|
|
23
|
+
- !Sub 'arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:parameter/*'
|
|
24
|
+
Condition:
|
|
25
|
+
StringEquals:
|
|
26
|
+
'ssm:ResourceTag/copilot-application': '__all__'
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/files.py
RENAMED
|
@@ -7,14 +7,6 @@ import yaml
|
|
|
7
7
|
from jinja2 import Environment
|
|
8
8
|
from jinja2 import FileSystemLoader
|
|
9
9
|
|
|
10
|
-
from dbt_platform_helper.constants import PLATFORM_CONFIG_FILE
|
|
11
|
-
|
|
12
|
-
CONFIG_FILE_MESSAGES = {
|
|
13
|
-
"storage.yml": " under the key 'extensions'",
|
|
14
|
-
"extensions.yml": " under the key 'extensions'",
|
|
15
|
-
"pipelines.yml": ", change the key 'codebases' to 'codebase_pipelines'",
|
|
16
|
-
}
|
|
17
|
-
|
|
18
10
|
|
|
19
11
|
def to_yaml(value):
|
|
20
12
|
return yaml.dump(value, sort_keys=False)
|
|
@@ -88,15 +80,25 @@ def apply_environment_defaults(config):
|
|
|
88
80
|
without_defaults_entry = {
|
|
89
81
|
name: data if data else {} for name, data in environments.items() if name != "*"
|
|
90
82
|
}
|
|
83
|
+
|
|
84
|
+
default_versions = config.get("default_versions", {})
|
|
85
|
+
|
|
86
|
+
def combine_env_data(data):
|
|
87
|
+
return {
|
|
88
|
+
**env_defaults,
|
|
89
|
+
**data,
|
|
90
|
+
"versions": {
|
|
91
|
+
**default_versions,
|
|
92
|
+
**env_defaults.get("versions", {}),
|
|
93
|
+
**data.get("versions", {}),
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
|
|
91
97
|
defaulted_envs = {
|
|
92
|
-
|
|
98
|
+
env_name: combine_env_data(env_data)
|
|
99
|
+
for env_name, env_data in without_defaults_entry.items()
|
|
93
100
|
}
|
|
94
101
|
|
|
95
102
|
enriched_config["environments"] = defaulted_envs
|
|
96
103
|
|
|
97
104
|
return enriched_config
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
def is_terraform_project() -> bool:
|
|
101
|
-
config = yaml.safe_load(Path(PLATFORM_CONFIG_FILE).read_text())
|
|
102
|
-
return not config.get("legacy_project", False)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
import yaml
|
|
4
|
+
|
|
5
|
+
from dbt_platform_helper.constants import PLATFORM_CONFIG_FILE
|
|
6
|
+
from dbt_platform_helper.utils.validation import load_and_validate_platform_config
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def get_environment_pipeline_names():
|
|
10
|
+
if not Path(PLATFORM_CONFIG_FILE).exists():
|
|
11
|
+
return {}
|
|
12
|
+
|
|
13
|
+
config = load_and_validate_platform_config(disable_aws_validation=True, disable_file_check=True)
|
|
14
|
+
return config.get("environment_pipelines", {}).keys()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def is_terraform_project() -> bool:
|
|
18
|
+
config = yaml.safe_load(Path(PLATFORM_CONFIG_FILE).read_text())
|
|
19
|
+
return not config.get("legacy_project", False)
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/validation.py
RENAMED
|
@@ -15,6 +15,7 @@ from yaml.parser import ParserError
|
|
|
15
15
|
from dbt_platform_helper.constants import CODEBASE_PIPELINES_KEY
|
|
16
16
|
from dbt_platform_helper.constants import ENVIRONMENTS_KEY
|
|
17
17
|
from dbt_platform_helper.constants import PLATFORM_CONFIG_FILE
|
|
18
|
+
from dbt_platform_helper.constants import PLATFORM_HELPER_VERSION_FILE
|
|
18
19
|
from dbt_platform_helper.utils.aws import get_aws_session_or_abort
|
|
19
20
|
from dbt_platform_helper.utils.files import apply_environment_defaults
|
|
20
21
|
from dbt_platform_helper.utils.messages import abort_with_error
|
|
@@ -93,10 +94,6 @@ def validate_s3_bucket_name(name: str):
|
|
|
93
94
|
if name.endswith(suffix):
|
|
94
95
|
errors.append(f"Names cannot be suffixed '{suffix}'.")
|
|
95
96
|
|
|
96
|
-
if not errors:
|
|
97
|
-
# Don't waste time calling AWS if the bucket name is not even valid.
|
|
98
|
-
warn_on_s3_bucket_name_availability(name)
|
|
99
|
-
|
|
100
97
|
if errors:
|
|
101
98
|
raise SchemaError(
|
|
102
99
|
S3_BUCKET_NAME_ERROR_TEMPLATE.format(name, "\n".join(f" {e}" for e in errors))
|
|
@@ -127,6 +124,8 @@ def validate_addons(addons: dict):
|
|
|
127
124
|
except SchemaError as ex:
|
|
128
125
|
errors[addon_name] = f"Error in {addon_name}: {ex.code}"
|
|
129
126
|
|
|
127
|
+
_validate_s3_bucket_uniqueness({"extensions": addons})
|
|
128
|
+
|
|
130
129
|
return errors
|
|
131
130
|
|
|
132
131
|
|
|
@@ -376,6 +375,17 @@ PROMETHEUS_POLICY_DEFINITION = {
|
|
|
376
375
|
},
|
|
377
376
|
}
|
|
378
377
|
|
|
378
|
+
_DEFAULT_VERSIONS_DEFINITION = {
|
|
379
|
+
Optional("terraform-platform-modules"): str,
|
|
380
|
+
Optional("platform-helper"): str,
|
|
381
|
+
}
|
|
382
|
+
_ENVIRONMENTS_VERSIONS_OVERRIDES = {
|
|
383
|
+
Optional("terraform-platform-modules"): str,
|
|
384
|
+
}
|
|
385
|
+
_PIPELINE_VERSIONS_OVERRIDES = {
|
|
386
|
+
Optional("platform-helper"): str,
|
|
387
|
+
}
|
|
388
|
+
|
|
379
389
|
_ENVIRONMENTS_PARAMS = {
|
|
380
390
|
Optional("accounts"): {
|
|
381
391
|
"deploy": {
|
|
@@ -388,14 +398,11 @@ _ENVIRONMENTS_PARAMS = {
|
|
|
388
398
|
},
|
|
389
399
|
},
|
|
390
400
|
Optional("requires_approval"): bool,
|
|
401
|
+
Optional("versions"): _ENVIRONMENTS_VERSIONS_OVERRIDES,
|
|
391
402
|
Optional("vpc"): str,
|
|
392
403
|
}
|
|
393
404
|
|
|
394
|
-
ENVIRONMENTS_DEFINITION = {
|
|
395
|
-
str: Or(
|
|
396
|
-
None, {**_ENVIRONMENTS_PARAMS, Optional("versions"): {"terraform-platform-modules": str}}
|
|
397
|
-
)
|
|
398
|
-
}
|
|
405
|
+
ENVIRONMENTS_DEFINITION = {str: Or(None, _ENVIRONMENTS_PARAMS)}
|
|
399
406
|
|
|
400
407
|
CODEBASE_PIPELINES_DEFINITION = [
|
|
401
408
|
{
|
|
@@ -435,6 +442,7 @@ ENVIRONMENT_PIPELINES_DEFINITION = {
|
|
|
435
442
|
Optional("account"): str,
|
|
436
443
|
Optional("branch", default="main"): str,
|
|
437
444
|
Optional("pipeline_to_trigger"): str,
|
|
445
|
+
Optional("versions"): _PIPELINE_VERSIONS_OVERRIDES,
|
|
438
446
|
"slack_channel": str,
|
|
439
447
|
"trigger_on_push": bool,
|
|
440
448
|
"environments": {str: Or(None, _ENVIRONMENTS_PARAMS)},
|
|
@@ -446,6 +454,7 @@ PLATFORM_CONFIG_SCHEMA = Schema(
|
|
|
446
454
|
# The following line is for the AWS Copilot version, will be removed under DBTP-1002
|
|
447
455
|
"application": str,
|
|
448
456
|
Optional("legacy_project", default=False): bool,
|
|
457
|
+
Optional("default_versions"): _DEFAULT_VERSIONS_DEFINITION,
|
|
449
458
|
Optional("accounts"): list[str],
|
|
450
459
|
Optional("environments"): ENVIRONMENTS_DEFINITION,
|
|
451
460
|
Optional("codebase_pipelines"): CODEBASE_PIPELINES_DEFINITION,
|
|
@@ -467,13 +476,30 @@ PLATFORM_CONFIG_SCHEMA = Schema(
|
|
|
467
476
|
)
|
|
468
477
|
|
|
469
478
|
|
|
470
|
-
def
|
|
471
|
-
|
|
479
|
+
def _validate_s3_bucket_uniqueness(enriched_config):
|
|
480
|
+
extensions = enriched_config.get("extensions", {})
|
|
481
|
+
bucket_extensions = [
|
|
482
|
+
s3_ext
|
|
483
|
+
for s3_ext in extensions.values()
|
|
484
|
+
if "type" in s3_ext and s3_ext["type"] in ("s3", "s3-policy")
|
|
485
|
+
]
|
|
486
|
+
environments = [
|
|
487
|
+
env for ext in bucket_extensions for env in ext.get("environments", {}).values()
|
|
488
|
+
]
|
|
489
|
+
bucket_names = [env.get("bucket_name") for env in environments]
|
|
490
|
+
|
|
491
|
+
for name in bucket_names:
|
|
492
|
+
warn_on_s3_bucket_name_availability(name)
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
def validate_platform_config(config, disable_aws_validation=False):
|
|
472
496
|
PLATFORM_CONFIG_SCHEMA.validate(config)
|
|
473
497
|
enriched_config = apply_environment_defaults(config)
|
|
474
498
|
_validate_environment_pipelines(enriched_config)
|
|
475
499
|
_validate_environment_pipelines_triggers(enriched_config)
|
|
476
500
|
_validate_codebase_pipelines(enriched_config)
|
|
501
|
+
if not disable_aws_validation:
|
|
502
|
+
_validate_s3_bucket_uniqueness(enriched_config)
|
|
477
503
|
|
|
478
504
|
|
|
479
505
|
def _validate_environment_pipelines(config):
|
|
@@ -545,11 +571,14 @@ def _validate_environment_pipelines_triggers(config):
|
|
|
545
571
|
abort_with_error(error_message + "\n ".join(errors))
|
|
546
572
|
|
|
547
573
|
|
|
548
|
-
def load_and_validate_platform_config(
|
|
549
|
-
|
|
574
|
+
def load_and_validate_platform_config(
|
|
575
|
+
path=PLATFORM_CONFIG_FILE, disable_aws_validation=False, disable_file_check=False
|
|
576
|
+
):
|
|
577
|
+
if not disable_file_check:
|
|
578
|
+
config_file_check(path)
|
|
550
579
|
try:
|
|
551
580
|
conf = yaml.safe_load(Path(path).read_text())
|
|
552
|
-
validate_platform_config(conf)
|
|
581
|
+
validate_platform_config(conf, disable_aws_validation)
|
|
553
582
|
return conf
|
|
554
583
|
except ParserError:
|
|
555
584
|
abort_with_error(f"{PLATFORM_CONFIG_FILE} is not valid YAML")
|
|
@@ -558,28 +587,39 @@ def load_and_validate_platform_config(path=PLATFORM_CONFIG_FILE):
|
|
|
558
587
|
def config_file_check(path=PLATFORM_CONFIG_FILE):
|
|
559
588
|
platform_config_exists = Path(path).exists()
|
|
560
589
|
errors = []
|
|
590
|
+
warnings = []
|
|
561
591
|
|
|
562
592
|
messages = {
|
|
563
|
-
"storage.yml": " under the key 'extensions'",
|
|
564
|
-
"extensions.yml": " under the key 'extensions'",
|
|
565
|
-
"pipelines.yml":
|
|
593
|
+
"storage.yml": {"instruction": " under the key 'extensions'", "type": errors},
|
|
594
|
+
"extensions.yml": {"instruction": " under the key 'extensions'", "type": errors},
|
|
595
|
+
"pipelines.yml": {
|
|
596
|
+
"instruction": ", change the key 'codebases' to 'codebase_pipelines'",
|
|
597
|
+
"type": errors,
|
|
598
|
+
},
|
|
599
|
+
PLATFORM_HELPER_VERSION_FILE: {
|
|
600
|
+
"instruction": ", under the key `default_versions: platform-helper:`",
|
|
601
|
+
"type": warnings,
|
|
602
|
+
},
|
|
566
603
|
}
|
|
567
604
|
|
|
568
605
|
for file in messages.keys():
|
|
569
606
|
if Path(file).exists():
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
607
|
+
message = (
|
|
608
|
+
f"`{file}` is no longer supported. Please move its contents into the "
|
|
609
|
+
f"`{PLATFORM_CONFIG_FILE}` file{messages[file]['instruction']} and delete `{file}`."
|
|
610
|
+
)
|
|
611
|
+
messages[file]["type"].append(message)
|
|
575
612
|
|
|
576
|
-
if not errors and not platform_config_exists:
|
|
613
|
+
if not errors and not warnings and not platform_config_exists:
|
|
577
614
|
errors.append(
|
|
578
|
-
f"`{PLATFORM_CONFIG_FILE}` is missing.
|
|
615
|
+
f"`{PLATFORM_CONFIG_FILE}` is missing. "
|
|
616
|
+
"Please check it exists and you are in the root directory of your deployment project."
|
|
579
617
|
)
|
|
580
618
|
|
|
619
|
+
if warnings:
|
|
620
|
+
click.secho("\n".join(warnings), bg="yellow", fg="black")
|
|
581
621
|
if errors:
|
|
582
|
-
click.secho("\n".join(errors), bg="red")
|
|
622
|
+
click.secho("\n".join(errors), bg="red", fg="white")
|
|
583
623
|
exit(1)
|
|
584
624
|
|
|
585
625
|
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/versioning.py
RENAMED
|
@@ -1,41 +1,56 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import re
|
|
3
3
|
import subprocess
|
|
4
|
+
from importlib.metadata import PackageNotFoundError
|
|
4
5
|
from importlib.metadata import version
|
|
5
6
|
from pathlib import Path
|
|
7
|
+
from typing import Optional
|
|
6
8
|
from typing import Tuple
|
|
7
9
|
from typing import Union
|
|
8
10
|
|
|
9
11
|
import click
|
|
10
12
|
import requests
|
|
11
13
|
|
|
14
|
+
from dbt_platform_helper.constants import PLATFORM_CONFIG_FILE
|
|
15
|
+
from dbt_platform_helper.constants import PLATFORM_HELPER_VERSION_FILE
|
|
12
16
|
from dbt_platform_helper.exceptions import IncompatibleMajorVersion
|
|
13
17
|
from dbt_platform_helper.exceptions import IncompatibleMinorVersion
|
|
14
18
|
from dbt_platform_helper.exceptions import ValidationException
|
|
15
|
-
from dbt_platform_helper.utils.
|
|
19
|
+
from dbt_platform_helper.utils.validation import load_and_validate_platform_config
|
|
20
|
+
|
|
21
|
+
VersionTuple = Optional[Tuple[int, int, int]]
|
|
16
22
|
|
|
17
23
|
|
|
18
24
|
class Versions:
|
|
19
|
-
def __init__(self, local_version=None, latest_release=None):
|
|
25
|
+
def __init__(self, local_version: VersionTuple = None, latest_release: VersionTuple = None):
|
|
20
26
|
self.local_version = local_version
|
|
21
27
|
self.latest_release = latest_release
|
|
22
28
|
|
|
23
29
|
|
|
24
30
|
class PlatformHelperVersions:
|
|
25
|
-
def __init__(
|
|
31
|
+
def __init__(
|
|
32
|
+
self,
|
|
33
|
+
local_version: VersionTuple = None,
|
|
34
|
+
latest_release: VersionTuple = None,
|
|
35
|
+
platform_helper_file_version: VersionTuple = None,
|
|
36
|
+
platform_config_default: VersionTuple = None,
|
|
37
|
+
pipeline_overrides: dict[str, str] = None,
|
|
38
|
+
):
|
|
26
39
|
self.local_version = local_version
|
|
27
40
|
self.latest_release = latest_release
|
|
28
41
|
self.platform_helper_file_version = platform_helper_file_version
|
|
42
|
+
self.platform_config_default = platform_config_default
|
|
43
|
+
self.pipeline_overrides = pipeline_overrides
|
|
29
44
|
|
|
30
45
|
|
|
31
|
-
def string_version(input_version:
|
|
46
|
+
def string_version(input_version: VersionTuple) -> str:
|
|
32
47
|
if input_version is None:
|
|
33
48
|
return "unknown"
|
|
34
49
|
major, minor, patch = input_version
|
|
35
50
|
return ".".join([str(s) for s in [major, minor, patch]])
|
|
36
51
|
|
|
37
52
|
|
|
38
|
-
def parse_version(input_version: Union[str, None]) ->
|
|
53
|
+
def parse_version(input_version: Union[str, None]) -> VersionTuple:
|
|
39
54
|
if input_version is None:
|
|
40
55
|
return None
|
|
41
56
|
|
|
@@ -90,28 +105,72 @@ def get_github_released_version(repository: str, tags: bool = False) -> Tuple[in
|
|
|
90
105
|
|
|
91
106
|
|
|
92
107
|
def get_platform_helper_versions() -> PlatformHelperVersions:
|
|
93
|
-
|
|
108
|
+
try:
|
|
109
|
+
locally_installed_version = parse_version(version("dbt-platform-helper"))
|
|
110
|
+
except PackageNotFoundError:
|
|
111
|
+
locally_installed_version = None
|
|
94
112
|
|
|
95
113
|
package_info = requests.get("https://pypi.org/pypi/dbt-platform-helper/json").json()
|
|
96
114
|
released_versions = package_info["releases"].keys()
|
|
97
115
|
parsed_released_versions = [parse_version(v) for v in released_versions]
|
|
98
116
|
parsed_released_versions.sort(reverse=True)
|
|
99
117
|
latest_release = parsed_released_versions[0]
|
|
118
|
+
platform_config = load_and_validate_platform_config(disable_aws_validation=True)
|
|
119
|
+
platform_config_default = parse_version(
|
|
120
|
+
platform_config.get("default_versions", {}).get("platform-helper")
|
|
121
|
+
)
|
|
100
122
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
123
|
+
pipeline_overrides = {
|
|
124
|
+
name: pipeline.get("versions", {}).get("platform-helper")
|
|
125
|
+
for name, pipeline in platform_config.get("environment_pipelines", {}).items()
|
|
126
|
+
if pipeline.get("versions", {}).get("platform-helper")
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
deprecated_version_file = Path(PLATFORM_HELPER_VERSION_FILE)
|
|
130
|
+
version_from_file = (
|
|
131
|
+
parse_version(deprecated_version_file.read_text())
|
|
132
|
+
if deprecated_version_file.exists()
|
|
133
|
+
else None
|
|
134
|
+
)
|
|
108
135
|
|
|
109
|
-
|
|
136
|
+
out = PlatformHelperVersions(
|
|
110
137
|
local_version=locally_installed_version,
|
|
111
138
|
latest_release=latest_release,
|
|
112
139
|
platform_helper_file_version=version_from_file,
|
|
140
|
+
platform_config_default=platform_config_default,
|
|
141
|
+
pipeline_overrides=pipeline_overrides,
|
|
113
142
|
)
|
|
114
143
|
|
|
144
|
+
_process_version_file_warnings(out)
|
|
145
|
+
|
|
146
|
+
return out
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def _process_version_file_warnings(versions: PlatformHelperVersions):
|
|
150
|
+
messages = []
|
|
151
|
+
missing_default_version_message = f"Create a section in the root of '{PLATFORM_CONFIG_FILE}':\n\ndefault_versions:\n platform-helper: "
|
|
152
|
+
deprecation_message = f"Please delete '{PLATFORM_HELPER_VERSION_FILE}' as it is now deprecated."
|
|
153
|
+
|
|
154
|
+
if versions.platform_config_default and versions.platform_helper_file_version:
|
|
155
|
+
messages.append(deprecation_message)
|
|
156
|
+
|
|
157
|
+
if versions.platform_config_default and not versions.platform_helper_file_version:
|
|
158
|
+
return
|
|
159
|
+
|
|
160
|
+
if not versions.platform_config_default and versions.platform_helper_file_version:
|
|
161
|
+
messages.append(deprecation_message)
|
|
162
|
+
messages.append(
|
|
163
|
+
f"{missing_default_version_message}{string_version(versions.platform_helper_file_version)}\n"
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
if not versions.platform_config_default and not versions.platform_helper_file_version:
|
|
167
|
+
messages.append(f"Cannot get dbt-platform-helper version from '{PLATFORM_CONFIG_FILE}'.")
|
|
168
|
+
messages.append(
|
|
169
|
+
f"{missing_default_version_message}{string_version(versions.local_version)}\n"
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
click.secho("\n".join(messages), fg="yellow")
|
|
173
|
+
|
|
115
174
|
|
|
116
175
|
def validate_version_compatibility(
|
|
117
176
|
app_version: Tuple[int, int, int], check_version: Tuple[int, int, int]
|
|
@@ -160,12 +219,6 @@ def validate_template_version(app_version: Tuple[int, int, int], template_file_p
|
|
|
160
219
|
)
|
|
161
220
|
|
|
162
221
|
|
|
163
|
-
def generate_platform_helper_version_file(directory="."):
|
|
164
|
-
base_path = Path(directory)
|
|
165
|
-
local_version = string_version(get_platform_helper_versions().local_version)
|
|
166
|
-
click.echo(mkfile(base_path, ".platform-helper-version", f"{local_version}\n"))
|
|
167
|
-
|
|
168
|
-
|
|
169
222
|
def check_platform_helper_version_needs_update():
|
|
170
223
|
if not running_as_installed_package() or "PLATFORM_TOOLS_SKIP_VERSION_CHECK" in os.environ:
|
|
171
224
|
return
|
|
@@ -197,10 +250,25 @@ def check_platform_helper_version_mismatch():
|
|
|
197
250
|
if not check_version_on_file_compatibility(local_version, platform_helper_file_version):
|
|
198
251
|
message = (
|
|
199
252
|
f"WARNING: You are running platform-helper v{string_version(local_version)} against "
|
|
200
|
-
f"v{string_version(platform_helper_file_version)} specified by .
|
|
253
|
+
f"v{string_version(platform_helper_file_version)} specified by {PLATFORM_HELPER_VERSION_FILE}."
|
|
201
254
|
)
|
|
202
255
|
click.secho(message, fg="red")
|
|
203
256
|
|
|
204
257
|
|
|
205
258
|
def running_as_installed_package():
|
|
206
259
|
return "site-packages" in __file__
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
def get_required_platform_helper_version(pipeline: str = None) -> str:
|
|
263
|
+
versions = get_platform_helper_versions()
|
|
264
|
+
pipeline_version = versions.pipeline_overrides.get(pipeline)
|
|
265
|
+
version_precedence = [
|
|
266
|
+
pipeline_version,
|
|
267
|
+
versions.platform_config_default,
|
|
268
|
+
versions.platform_helper_file_version,
|
|
269
|
+
]
|
|
270
|
+
non_null_version_precedence = [
|
|
271
|
+
string_version(v) if isinstance(v, tuple) else v for v in version_precedence if v
|
|
272
|
+
]
|
|
273
|
+
|
|
274
|
+
return non_null_version_precedence[0] if non_null_version_precedence else None
|
|
@@ -20,6 +20,7 @@ from dbt_platform_helper.commands.generate import generate as generate_commands
|
|
|
20
20
|
from dbt_platform_helper.commands.notify import notify as notify_commands
|
|
21
21
|
from dbt_platform_helper.commands.pipeline import pipeline as pipeline_commands
|
|
22
22
|
from dbt_platform_helper.commands.secrets import secrets as secrets_commands
|
|
23
|
+
from dbt_platform_helper.commands.version import version as version_commands
|
|
23
24
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
24
25
|
|
|
25
26
|
|
|
@@ -46,6 +47,7 @@ platform_helper.add_command(pipeline_commands)
|
|
|
46
47
|
platform_helper.add_command(secrets_commands)
|
|
47
48
|
platform_helper.add_command(notify_commands)
|
|
48
49
|
platform_helper.add_command(database_commands)
|
|
50
|
+
platform_helper.add_command(version_commands)
|
|
49
51
|
|
|
50
52
|
if __name__ == "__main__":
|
|
51
53
|
platform_helper()
|
|
@@ -3,7 +3,7 @@ line-length = 100
|
|
|
3
3
|
|
|
4
4
|
[tool.poetry]
|
|
5
5
|
name = "dbt-platform-helper"
|
|
6
|
-
version = "10.
|
|
6
|
+
version = "10.7.1"
|
|
7
7
|
description = "Set of tools to help transfer applications/services from GOV.UK PaaS to DBT PaaS augmenting AWS Copilot."
|
|
8
8
|
authors = ["Department for Business and Trade Platform Team <sre-team@digital.trade.gov.uk>"]
|
|
9
9
|
license = "MIT"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/addon-plans.yml
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/codebase.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/config.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/database.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/dns.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/notify.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/commands/secrets.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/default-extensions.yml
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/jinja2_tags.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/__init__.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/application.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/arn_parser.py
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/click.py
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/cloudfoundry.py
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/manifests.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/messages.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.6.1 → dbt_platform_helper-10.7.1}/dbt_platform_helper/utils/template.py
RENAMED
|
File without changes
|