dbt-platform-helper 11.1.0__tar.gz → 11.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dbt-platform-helper might be problematic. Click here for more details.
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/PKG-INFO +1 -1
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/COMMANDS.md +23 -1
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/pipeline.py +103 -12
- dbt_platform_helper-11.2.0/dbt_platform_helper/templates/environment-pipelines/main.tf +52 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/pyproject.toml +1 -1
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/LICENSE +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/README.md +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/__init__.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/addon-plans.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/addons-template-map.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/__init__.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/application.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/check_cloudformation.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/codebase.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/conduit.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/config.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/copilot.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/database.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/dns.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/environment.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/generate.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/notify.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/secrets.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/version.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/constants.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/custom_resources/__init__.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/custom_resources/s3_object.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/default-extensions.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/domain/__init__.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/domain/database_copy.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/domain/maintenance_page.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/exceptions.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/jinja2_tags.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/providers/load_balancers.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/.copilot/config.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/.copilot/image_build_run.sh +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/.copilot/phases/build.sh +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/.copilot/phases/install.sh +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/.copilot/phases/post_build.sh +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/.copilot/phases/pre_build.sh +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/COMMANDS.md.jinja +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addon-instructions.txt +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addons/README.md +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addons/env/addons.parameters.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addons/env/aurora-postgres.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addons/env/monitoring.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addons/env/opensearch.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addons/env/rds-postgres.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addons/env/redis-cluster.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addons/env/s3.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addons/env/vpc.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addons/svc/appconfig-ipfilter.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addons/svc/prometheus-policy.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addons/svc/s3-policy.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/addons/svc/subscription-filter.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/ci-codebuild-role-policy.json +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/create-codebuild-role.json +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/custom-codebuild-role-policy.json +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/env/manifest.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/env/overrides/.gitignore +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/env/overrides/README.md +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/env/overrides/bin/override.ts +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/env/overrides/cdk.json +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/env/overrides/log_resource_policy.json +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/env/overrides/package-lock.json +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/env/overrides/package.json +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/env/overrides/stack.ts +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/env/overrides/tsconfig.json +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/env/terraform-overrides/cfn.patches.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/environments/main.tf +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/codebase/manifest.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/.gitignore +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/bin/override.ts +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/buildspec.deploy.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/buildspec.image.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/cdk.json +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/package-lock.json +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/package.json +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/stack.ts +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/tsconfig.json +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/types.ts +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/environments/buildspec.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/environments/manifest.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/pipelines/environments/overrides/cfn.patches.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/svc/maintenance_pages/default.html +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/svc/maintenance_pages/dmas-migration.html +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/svc/maintenance_pages/migration.html +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/svc/manifest-backend.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/svc/manifest-public.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/templates/svc/overrides/cfn.patches.yml +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/__init__.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/application.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/arn_parser.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/aws.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/click.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/cloudformation.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/cloudfoundry.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/files.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/git.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/manifests.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/messages.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/platform_config.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/template.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/validation.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/versioning.py +0 -0
- {dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/platform_helper.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dbt-platform-helper
|
|
3
|
-
Version: 11.
|
|
3
|
+
Version: 11.2.0
|
|
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
|
|
@@ -793,14 +793,36 @@ platform-helper pipeline generate
|
|
|
793
793
|
Given a platform-config.yml file, generate environment and service
|
|
794
794
|
deployment pipelines.
|
|
795
795
|
|
|
796
|
+
This command does the following in relation to the environment pipelines:
|
|
797
|
+
- Reads contents of `platform-config.yml/environment-pipelines` configuration.
|
|
798
|
+
The `terraform/environment-pipelines/<aws_account>/main.tf` file is generated using this configuration.
|
|
799
|
+
The `main.tf` file is then used to generate Terraform for creating an environment pipeline resource.
|
|
800
|
+
|
|
801
|
+
This command does the following in relation to the codebase pipelines:
|
|
802
|
+
- Generates the copilot pipeline manifest.yml for copilot/pipelines/<codebase_pipeline_name>
|
|
803
|
+
|
|
804
|
+
(Deprecated) This command does the following for non terraform projects (legacy AWS Copilot):
|
|
805
|
+
- Generates the copilot manifest.yml for copilot/environments/<environment>
|
|
806
|
+
|
|
796
807
|
## Usage
|
|
797
808
|
|
|
798
809
|
```
|
|
799
|
-
platform-helper pipeline generate
|
|
810
|
+
platform-helper pipeline generate [--terraform-platform-modules-version <terraform_platform_modules_version>]
|
|
811
|
+
[--deploy-branch <deploy_branch>]
|
|
800
812
|
```
|
|
801
813
|
|
|
802
814
|
## Options
|
|
803
815
|
|
|
816
|
+
- `--terraform-platform-modules-version <text>`
|
|
817
|
+
- Override the default version of terraform-platform-modules with a specific version or branch.
|
|
818
|
+
Precedence of version used is version supplied via CLI, then the version found in
|
|
819
|
+
platform-config.yml/default_versions/terraform-platform-modules.
|
|
820
|
+
In absence of these inputs, defaults to version '5'.
|
|
821
|
+
- `--deploy-branch <text>`
|
|
822
|
+
- Specify the branch of <application>-deploy used to configure the source stage in the environment-pipeline resource.
|
|
823
|
+
This is generated from the terraform/environments-pipeline/<aws_account>/main.tf file.
|
|
824
|
+
(Default <application>-deploy branch is specified in
|
|
825
|
+
<application>-deploy/platform-config.yml/environment_pipelines/<environment-pipeline>/branch).
|
|
804
826
|
- `--help <boolean>` _Defaults to False._
|
|
805
827
|
- Show this message and exit.
|
|
806
828
|
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/pipeline.py
RENAMED
|
@@ -5,6 +5,7 @@ from shutil import rmtree
|
|
|
5
5
|
|
|
6
6
|
import click
|
|
7
7
|
|
|
8
|
+
from dbt_platform_helper.constants import DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION
|
|
8
9
|
from dbt_platform_helper.utils.application import get_application_name
|
|
9
10
|
from dbt_platform_helper.utils.aws import get_account_details
|
|
10
11
|
from dbt_platform_helper.utils.aws import get_codestar_connection_arn
|
|
@@ -24,6 +25,7 @@ from dbt_platform_helper.utils.versioning import (
|
|
|
24
25
|
|
|
25
26
|
CODEBASE_PIPELINES_KEY = "codebase_pipelines"
|
|
26
27
|
ENVIRONMENTS_KEY = "environments"
|
|
28
|
+
ENVIRONMENT_PIPELINES_KEY = "environment_pipelines"
|
|
27
29
|
|
|
28
30
|
|
|
29
31
|
@click.group(chain=True, cls=ClickDocOptGroup)
|
|
@@ -33,18 +35,55 @@ def pipeline():
|
|
|
33
35
|
|
|
34
36
|
|
|
35
37
|
@pipeline.command()
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
38
|
+
@click.option(
|
|
39
|
+
"--terraform-platform-modules-version",
|
|
40
|
+
help=f"""Override the default version of terraform-platform-modules with a specific version or branch.
|
|
41
|
+
Precedence of version used is version supplied via CLI, then the version found in
|
|
42
|
+
platform-config.yml/default_versions/terraform-platform-modules.
|
|
43
|
+
In absence of these inputs, defaults to version '{DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION}'.""",
|
|
44
|
+
)
|
|
45
|
+
@click.option(
|
|
46
|
+
"--deploy-branch",
|
|
47
|
+
help="""Specify the branch of <application>-deploy used to configure the source stage in the environment-pipeline resource.
|
|
48
|
+
This is generated from the terraform/environments-pipeline/<aws_account>/main.tf file.
|
|
49
|
+
(Default <application>-deploy branch is specified in
|
|
50
|
+
<application>-deploy/platform-config.yml/environment_pipelines/<environment-pipeline>/branch).""",
|
|
51
|
+
default=None,
|
|
52
|
+
)
|
|
53
|
+
def generate(terraform_platform_modules_version, deploy_branch):
|
|
54
|
+
"""
|
|
55
|
+
Given a platform-config.yml file, generate environment and service
|
|
56
|
+
deployment pipelines.
|
|
57
|
+
|
|
58
|
+
This command does the following in relation to the environment pipelines:
|
|
59
|
+
- Reads contents of `platform-config.yml/environment-pipelines` configuration.
|
|
60
|
+
The `terraform/environment-pipelines/<aws_account>/main.tf` file is generated using this configuration.
|
|
61
|
+
The `main.tf` file is then used to generate Terraform for creating an environment pipeline resource.
|
|
62
|
+
|
|
63
|
+
This command does the following in relation to the codebase pipelines:
|
|
64
|
+
- Generates the copilot pipeline manifest.yml for copilot/pipelines/<codebase_pipeline_name>
|
|
65
|
+
|
|
66
|
+
(Deprecated) This command does the following for non terraform projects (legacy AWS Copilot):
|
|
67
|
+
- Generates the copilot manifest.yml for copilot/environments/<environment>
|
|
68
|
+
"""
|
|
39
69
|
pipeline_config = load_and_validate_platform_config()
|
|
40
70
|
|
|
41
|
-
|
|
42
|
-
|
|
71
|
+
has_codebase_pipelines = CODEBASE_PIPELINES_KEY in pipeline_config
|
|
72
|
+
has_legacy_environment_pipelines = ENVIRONMENTS_KEY in pipeline_config
|
|
73
|
+
has_environment_pipelines = ENVIRONMENT_PIPELINES_KEY in pipeline_config
|
|
43
74
|
|
|
44
|
-
if
|
|
75
|
+
if (
|
|
76
|
+
not has_codebase_pipelines
|
|
77
|
+
and not has_legacy_environment_pipelines
|
|
78
|
+
and not has_environment_pipelines
|
|
79
|
+
):
|
|
45
80
|
click.secho("No pipelines defined: nothing to do.", err=True, fg="yellow")
|
|
46
81
|
return
|
|
47
82
|
|
|
83
|
+
platform_config_terraform_modules_default_version = pipeline_config.get(
|
|
84
|
+
"default_versions", {}
|
|
85
|
+
).get("terraform-platform-modules", "")
|
|
86
|
+
|
|
48
87
|
templates = setup_templates()
|
|
49
88
|
app_name = get_application_name()
|
|
50
89
|
|
|
@@ -57,22 +96,34 @@ def generate():
|
|
|
57
96
|
abort_with_error(f'There is no CodeStar Connection named "{app_name}" to use')
|
|
58
97
|
|
|
59
98
|
base_path = Path(".")
|
|
60
|
-
|
|
99
|
+
copilot_pipelines_dir = base_path / f"copilot/pipelines"
|
|
61
100
|
|
|
62
|
-
_clean_pipeline_config(
|
|
101
|
+
_clean_pipeline_config(copilot_pipelines_dir)
|
|
63
102
|
|
|
64
|
-
if
|
|
103
|
+
if is_terraform_project() and has_environment_pipelines:
|
|
104
|
+
environment_pipelines = pipeline_config[ENVIRONMENT_PIPELINES_KEY]
|
|
105
|
+
|
|
106
|
+
for config in environment_pipelines.values():
|
|
107
|
+
aws_account = config.get("account")
|
|
108
|
+
_generate_terraform_environment_pipeline_manifest(
|
|
109
|
+
pipeline_config["application"],
|
|
110
|
+
aws_account,
|
|
111
|
+
terraform_platform_modules_version,
|
|
112
|
+
platform_config_terraform_modules_default_version,
|
|
113
|
+
deploy_branch,
|
|
114
|
+
)
|
|
115
|
+
if not is_terraform_project() and has_legacy_environment_pipelines:
|
|
65
116
|
_generate_copilot_environments_pipeline(
|
|
66
117
|
app_name,
|
|
67
118
|
codestar_connection_arn,
|
|
68
119
|
git_repo,
|
|
69
120
|
apply_environment_defaults(pipeline_config)[ENVIRONMENTS_KEY],
|
|
70
121
|
base_path,
|
|
71
|
-
|
|
122
|
+
copilot_pipelines_dir,
|
|
72
123
|
templates,
|
|
73
124
|
)
|
|
74
125
|
|
|
75
|
-
if
|
|
126
|
+
if has_codebase_pipelines:
|
|
76
127
|
account_id, _ = get_account_details()
|
|
77
128
|
|
|
78
129
|
for codebase in pipeline_config[CODEBASE_PIPELINES_KEY]:
|
|
@@ -83,7 +134,7 @@ def generate():
|
|
|
83
134
|
git_repo,
|
|
84
135
|
codebase,
|
|
85
136
|
base_path,
|
|
86
|
-
|
|
137
|
+
copilot_pipelines_dir,
|
|
87
138
|
templates,
|
|
88
139
|
)
|
|
89
140
|
|
|
@@ -170,3 +221,43 @@ def _create_file_from_template(
|
|
|
170
221
|
).render(template_data)
|
|
171
222
|
message = mkfile(base_path, pipelines_dir / file_name, contents, overwrite=True)
|
|
172
223
|
click.echo(message)
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
def _generate_terraform_environment_pipeline_manifest(
|
|
227
|
+
application,
|
|
228
|
+
aws_account,
|
|
229
|
+
cli_terraform_platform_modules_version,
|
|
230
|
+
platform_config_terraform_modules_default_version,
|
|
231
|
+
deploy_branch,
|
|
232
|
+
):
|
|
233
|
+
env_pipeline_template = setup_templates().get_template("environment-pipelines/main.tf")
|
|
234
|
+
|
|
235
|
+
terraform_platform_modules_version = _determine_terraform_platform_modules_version(
|
|
236
|
+
cli_terraform_platform_modules_version, platform_config_terraform_modules_default_version
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
contents = env_pipeline_template.render(
|
|
240
|
+
{
|
|
241
|
+
"application": application,
|
|
242
|
+
"aws_account": aws_account,
|
|
243
|
+
"terraform_platform_modules_version": terraform_platform_modules_version,
|
|
244
|
+
"deploy_branch": deploy_branch,
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
dir_path = f"terraform/environment-pipelines/{aws_account}"
|
|
249
|
+
makedirs(dir_path, exist_ok=True)
|
|
250
|
+
|
|
251
|
+
click.echo(mkfile(".", f"{dir_path}/main.tf", contents, overwrite=True))
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
def _determine_terraform_platform_modules_version(
|
|
255
|
+
cli_terraform_platform_modules_version, platform_config_terraform_modules_default_version
|
|
256
|
+
):
|
|
257
|
+
|
|
258
|
+
version_preference_order = [
|
|
259
|
+
cli_terraform_platform_modules_version,
|
|
260
|
+
platform_config_terraform_modules_default_version,
|
|
261
|
+
DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION,
|
|
262
|
+
]
|
|
263
|
+
return [version for version in version_preference_order if version][0]
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# {% extra_header %}
|
|
2
|
+
# {% version_info %}
|
|
3
|
+
locals {
|
|
4
|
+
platform_config = yamldecode(file("../../../platform-config.yml"))
|
|
5
|
+
all_pipelines = local.platform_config["environment_pipelines"]
|
|
6
|
+
pipelines = { for pipeline, config in local.platform_config["environment_pipelines"] : pipeline => config if config.account == "{{ aws_account }}" }
|
|
7
|
+
environment_config = local.platform_config["environments"]
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
provider "aws" {
|
|
11
|
+
region = "eu-west-2"
|
|
12
|
+
profile = "{{ aws_account }}"
|
|
13
|
+
alias = "{{ aws_account }}"
|
|
14
|
+
shared_credentials_files = ["~/.aws/config"]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
terraform {
|
|
18
|
+
required_version = "~> 1.8"
|
|
19
|
+
backend "s3" {
|
|
20
|
+
bucket = "terraform-platform-state-{{ aws_account }}"
|
|
21
|
+
key = "tfstate/application/{{ application }}-pipelines.tfstate"
|
|
22
|
+
region = "eu-west-2"
|
|
23
|
+
encrypt = true
|
|
24
|
+
kms_key_id = "alias/terraform-platform-state-s3-key-{{ aws_account }}"
|
|
25
|
+
dynamodb_table = "terraform-platform-lockdb-{{ aws_account }}"
|
|
26
|
+
}
|
|
27
|
+
required_providers {
|
|
28
|
+
aws = {
|
|
29
|
+
source = "hashicorp/aws"
|
|
30
|
+
version = "~> 5"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
module "environment-pipelines" {
|
|
37
|
+
source = "git::https://github.com/uktrade/terraform-platform-modules.git//environment-pipelines?depth=1&ref={{ terraform_platform_modules_version }}"
|
|
38
|
+
|
|
39
|
+
for_each = local.pipelines
|
|
40
|
+
|
|
41
|
+
application = "{{ application }}"
|
|
42
|
+
pipeline_name = each.key
|
|
43
|
+
repository = "uktrade/{{ application }}-deploy"
|
|
44
|
+
|
|
45
|
+
environments = each.value.environments
|
|
46
|
+
all_pipelines = local.all_pipelines
|
|
47
|
+
environment_config = local.environment_config
|
|
48
|
+
branch = {% if deploy_branch %}"{{ deploy_branch }}"{% else %}each.value.branch{% endif %}
|
|
49
|
+
slack_channel = each.value.slack_channel
|
|
50
|
+
trigger_on_push = each.value.trigger_on_push
|
|
51
|
+
pipeline_to_trigger = lookup(each.value, "pipeline_to_trigger", null)
|
|
52
|
+
}
|
|
@@ -3,7 +3,7 @@ line-length = 100
|
|
|
3
3
|
|
|
4
4
|
[tool.poetry]
|
|
5
5
|
name = "dbt-platform-helper"
|
|
6
|
-
version = "11.
|
|
6
|
+
version = "11.2.0"
|
|
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-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/addon-plans.yml
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/codebase.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/conduit.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/config.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/copilot.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/database.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/dns.py
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/generate.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/notify.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/secrets.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/commands/version.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/default-extensions.yml
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/domain/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/__init__.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/application.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/arn_parser.py
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/click.py
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/cloudfoundry.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/files.py
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/manifests.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/messages.py
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/template.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/validation.py
RENAMED
|
File without changes
|
{dbt_platform_helper-11.1.0 → dbt_platform_helper-11.2.0}/dbt_platform_helper/utils/versioning.py
RENAMED
|
File without changes
|
|
File without changes
|