dbt-platform-helper 10.7.1__py3-none-any.whl → 10.7.3__py3-none-any.whl
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/commands/copilot.py +1 -2
- dbt_platform_helper/templates/pipelines/environments/buildspec.yml +10 -8
- dbt_platform_helper/utils/versioning.py +44 -29
- {dbt_platform_helper-10.7.1.dist-info → dbt_platform_helper-10.7.3.dist-info}/METADATA +1 -1
- {dbt_platform_helper-10.7.1.dist-info → dbt_platform_helper-10.7.3.dist-info}/RECORD +8 -8
- {dbt_platform_helper-10.7.1.dist-info → dbt_platform_helper-10.7.3.dist-info}/LICENSE +0 -0
- {dbt_platform_helper-10.7.1.dist-info → dbt_platform_helper-10.7.3.dist-info}/WHEEL +0 -0
- {dbt_platform_helper-10.7.1.dist-info → dbt_platform_helper-10.7.3.dist-info}/entry_points.txt +0 -0
|
@@ -216,8 +216,6 @@ def _generate_svc_overrides(base_path, templates, name):
|
|
|
216
216
|
|
|
217
217
|
def _get_s3_kms_alias_arns(session, application_name, config):
|
|
218
218
|
application = load_application(application_name, session)
|
|
219
|
-
# create kms client
|
|
220
|
-
kms_client = session.client("kms")
|
|
221
219
|
arns = {}
|
|
222
220
|
|
|
223
221
|
for environment_name in application.environments:
|
|
@@ -225,6 +223,7 @@ def _get_s3_kms_alias_arns(session, application_name, config):
|
|
|
225
223
|
continue
|
|
226
224
|
|
|
227
225
|
bucket_name = config[environment_name]["bucket_name"]
|
|
226
|
+
kms_client = application.environments[environment_name].session.client("kms")
|
|
228
227
|
alias_name = f"alias/{application_name}-{environment_name}-{bucket_name}-key"
|
|
229
228
|
|
|
230
229
|
try:
|
|
@@ -14,21 +14,24 @@ phases:
|
|
|
14
14
|
echo "Cannot find .copilot-version file"
|
|
15
15
|
exit 1
|
|
16
16
|
fi
|
|
17
|
+
- COPILOT_VERSION=$(cat .copilot-version)
|
|
18
|
+
# Install pyyaml and dbt-platform-helper
|
|
19
|
+
- pip install PyYAML dbt-platform-helper
|
|
20
|
+
# Reinstall if we require a different version to the latest
|
|
21
|
+
- CURRENT_PLATFORM_HELPER_VERSION=$(platform-helper --version)
|
|
22
|
+
- export PLATFORM_HELPER_VERSION=$(platform-helper version get-platform-helper-for-project)
|
|
17
23
|
- |
|
|
18
|
-
if [ !
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
if [ ! "${PLATFORM_HELPER_VERSION}" == "${CURRENT_PLATFORM_HELPER_VERSION}" ]
|
|
25
|
+
then
|
|
26
|
+
pip uninstall dbt-platform-helper
|
|
27
|
+
pip install dbt-platform-helper==$PLATFORM_HELPER_VERSION
|
|
21
28
|
fi
|
|
22
|
-
- COPILOT_VERSION=`cat .copilot-version`
|
|
23
|
-
- PLATFORM_HELPER_VERSION=`cat .platform-helper-version`
|
|
24
29
|
- mkdir ./build-tools
|
|
25
30
|
- cd ./build-tools
|
|
26
31
|
# Install copilot
|
|
27
32
|
- wget -q "https://ecs-cli-v2-release.s3.amazonaws.com/copilot-linux-v${COPILOT_VERSION}"
|
|
28
33
|
- mv "./copilot-linux-v${COPILOT_VERSION}" ./copilot
|
|
29
34
|
- chmod +x ./copilot
|
|
30
|
-
# Install pyyaml and dbt-platform-helper
|
|
31
|
-
- pip install PyYAML dbt-platform-helper==$PLATFORM_HELPER_VERSION
|
|
32
35
|
# Install dyff - yaml differ
|
|
33
36
|
- wget -q "https://github.com/homeport/dyff/releases/download/v${DYFF_VERSION}/dyff_${DYFF_VERSION}_linux_amd64.tar.gz"
|
|
34
37
|
- tar -zxvf "dyff_${DYFF_VERSION}_linux_amd64.tar.gz"
|
|
@@ -36,7 +39,6 @@ phases:
|
|
|
36
39
|
build:
|
|
37
40
|
commands:
|
|
38
41
|
- cd $CODEBUILD_SRC_DIR
|
|
39
|
-
- PLATFORM_HELPER_VERSION=`cat .platform-helper-version`
|
|
40
42
|
- cp -r copilot/ current-copilot/
|
|
41
43
|
- platform-helper copilot make-addons
|
|
42
44
|
- >
|
|
@@ -40,7 +40,7 @@ class PlatformHelperVersions:
|
|
|
40
40
|
self.latest_release = latest_release
|
|
41
41
|
self.platform_helper_file_version = platform_helper_file_version
|
|
42
42
|
self.platform_config_default = platform_config_default
|
|
43
|
-
self.pipeline_overrides = pipeline_overrides
|
|
43
|
+
self.pipeline_overrides = pipeline_overrides if pipeline_overrides else {}
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
def string_version(input_version: VersionTuple) -> str:
|
|
@@ -104,7 +104,7 @@ def get_github_released_version(repository: str, tags: bool = False) -> Tuple[in
|
|
|
104
104
|
return parse_version(package_info["tag_name"])
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
def get_platform_helper_versions() -> PlatformHelperVersions:
|
|
107
|
+
def get_platform_helper_versions(include_project_versions=True) -> PlatformHelperVersions:
|
|
108
108
|
try:
|
|
109
109
|
locally_installed_version = parse_version(version("dbt-platform-helper"))
|
|
110
110
|
except PackageNotFoundError:
|
|
@@ -115,23 +115,27 @@ def get_platform_helper_versions() -> PlatformHelperVersions:
|
|
|
115
115
|
parsed_released_versions = [parse_version(v) for v in released_versions]
|
|
116
116
|
parsed_released_versions.sort(reverse=True)
|
|
117
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
|
-
)
|
|
122
118
|
|
|
123
|
-
pipeline_overrides = {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
119
|
+
platform_config_default, pipeline_overrides, version_from_file = None, {}, None
|
|
120
|
+
|
|
121
|
+
if include_project_versions:
|
|
122
|
+
platform_config = load_and_validate_platform_config(disable_aws_validation=True)
|
|
123
|
+
platform_config_default = parse_version(
|
|
124
|
+
platform_config.get("default_versions", {}).get("platform-helper")
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
pipeline_overrides = {
|
|
128
|
+
name: pipeline.get("versions", {}).get("platform-helper")
|
|
129
|
+
for name, pipeline in platform_config.get("environment_pipelines", {}).items()
|
|
130
|
+
if pipeline.get("versions", {}).get("platform-helper")
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
deprecated_version_file = Path(PLATFORM_HELPER_VERSION_FILE)
|
|
134
|
+
version_from_file = (
|
|
135
|
+
parse_version(deprecated_version_file.read_text())
|
|
136
|
+
if deprecated_version_file.exists()
|
|
137
|
+
else None
|
|
138
|
+
)
|
|
135
139
|
|
|
136
140
|
out = PlatformHelperVersions(
|
|
137
141
|
local_version=locally_installed_version,
|
|
@@ -141,7 +145,8 @@ def get_platform_helper_versions() -> PlatformHelperVersions:
|
|
|
141
145
|
pipeline_overrides=pipeline_overrides,
|
|
142
146
|
)
|
|
143
147
|
|
|
144
|
-
|
|
148
|
+
if include_project_versions:
|
|
149
|
+
_process_version_file_warnings(out)
|
|
145
150
|
|
|
146
151
|
return out
|
|
147
152
|
|
|
@@ -164,12 +169,12 @@ def _process_version_file_warnings(versions: PlatformHelperVersions):
|
|
|
164
169
|
)
|
|
165
170
|
|
|
166
171
|
if not versions.platform_config_default and not versions.platform_helper_file_version:
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
)
|
|
172
|
+
message = f"Cannot get dbt-platform-helper version from '{PLATFORM_CONFIG_FILE}'.\n"
|
|
173
|
+
message += f"{missing_default_version_message}{string_version(versions.local_version)}\n"
|
|
174
|
+
click.secho(message, fg="red")
|
|
171
175
|
|
|
172
|
-
|
|
176
|
+
if messages:
|
|
177
|
+
click.secho("\n".join(messages), fg="yellow")
|
|
173
178
|
|
|
174
179
|
|
|
175
180
|
def validate_version_compatibility(
|
|
@@ -223,7 +228,7 @@ def check_platform_helper_version_needs_update():
|
|
|
223
228
|
if not running_as_installed_package() or "PLATFORM_TOOLS_SKIP_VERSION_CHECK" in os.environ:
|
|
224
229
|
return
|
|
225
230
|
|
|
226
|
-
versions = get_platform_helper_versions()
|
|
231
|
+
versions = get_platform_helper_versions(include_project_versions=False)
|
|
227
232
|
local_version = versions.local_version
|
|
228
233
|
latest_release = versions.latest_release
|
|
229
234
|
message = (
|
|
@@ -245,7 +250,9 @@ def check_platform_helper_version_mismatch():
|
|
|
245
250
|
|
|
246
251
|
versions = get_platform_helper_versions()
|
|
247
252
|
local_version = versions.local_version
|
|
248
|
-
platform_helper_file_version =
|
|
253
|
+
platform_helper_file_version = parse_version(
|
|
254
|
+
get_required_platform_helper_version(versions=versions)
|
|
255
|
+
)
|
|
249
256
|
|
|
250
257
|
if not check_version_on_file_compatibility(local_version, platform_helper_file_version):
|
|
251
258
|
message = (
|
|
@@ -259,8 +266,11 @@ def running_as_installed_package():
|
|
|
259
266
|
return "site-packages" in __file__
|
|
260
267
|
|
|
261
268
|
|
|
262
|
-
def get_required_platform_helper_version(
|
|
263
|
-
versions =
|
|
269
|
+
def get_required_platform_helper_version(
|
|
270
|
+
pipeline: str = None, versions: PlatformHelperVersions = None
|
|
271
|
+
) -> str:
|
|
272
|
+
if not versions:
|
|
273
|
+
versions = get_platform_helper_versions()
|
|
264
274
|
pipeline_version = versions.pipeline_overrides.get(pipeline)
|
|
265
275
|
version_precedence = [
|
|
266
276
|
pipeline_version,
|
|
@@ -271,4 +281,9 @@ def get_required_platform_helper_version(pipeline: str = None) -> str:
|
|
|
271
281
|
string_version(v) if isinstance(v, tuple) else v for v in version_precedence if v
|
|
272
282
|
]
|
|
273
283
|
|
|
274
|
-
|
|
284
|
+
out = non_null_version_precedence[0] if non_null_version_precedence else None
|
|
285
|
+
|
|
286
|
+
if not out:
|
|
287
|
+
raise SystemExit(1)
|
|
288
|
+
|
|
289
|
+
return out
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dbt-platform-helper
|
|
3
|
-
Version: 10.7.
|
|
3
|
+
Version: 10.7.3
|
|
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
|
|
@@ -9,7 +9,7 @@ dbt_platform_helper/commands/check_cloudformation.py,sha256=aLif3yMHKuZO0uvdUjTH
|
|
|
9
9
|
dbt_platform_helper/commands/codebase.py,sha256=NchJzH-yxv5mXCe2rPyXVNHmXGEvjFUv0KhMKYsLNNQ,11380
|
|
10
10
|
dbt_platform_helper/commands/conduit.py,sha256=M_-Lrcph4c4PFivfEzDEL2_PW_OzZaOtZXpgo_Ao3DU,14882
|
|
11
11
|
dbt_platform_helper/commands/config.py,sha256=NOHea7OAjrl6XHlW6HMLn0m0T5lFPyNH3HXoyCOWsJk,12070
|
|
12
|
-
dbt_platform_helper/commands/copilot.py,sha256=
|
|
12
|
+
dbt_platform_helper/commands/copilot.py,sha256=hGaF3631BCx9SKyY7BB-xK0B9cENK9UKffGiDO2Cp0Q,16556
|
|
13
13
|
dbt_platform_helper/commands/database.py,sha256=-DacXZ2LhwV3CRukG35urEU2TuNVZHppUA3EhbBNjUs,4840
|
|
14
14
|
dbt_platform_helper/commands/dns.py,sha256=o7PkvHktZo0jmqbx0krJTL0R4GtWSf1rF2KDEWor8Ts,35211
|
|
15
15
|
dbt_platform_helper/commands/environment.py,sha256=u4yl2fZa2XnzA5o8gk1x0_YfPqLCJAraaU6YU74mSxo,22563
|
|
@@ -71,7 +71,7 @@ dbt_platform_helper/templates/pipelines/codebase/overrides/package.json,sha256=X
|
|
|
71
71
|
dbt_platform_helper/templates/pipelines/codebase/overrides/stack.ts,sha256=vJNqtku74BEJ_sew1485_JQLKxpozI4md08tokg2LgE,20895
|
|
72
72
|
dbt_platform_helper/templates/pipelines/codebase/overrides/tsconfig.json,sha256=k6KabP-WwhFNgA1AFHNuonTEAnES6eR74jUuYUJEGOM,651
|
|
73
73
|
dbt_platform_helper/templates/pipelines/codebase/overrides/types.ts,sha256=Sp4nEppsreaY1nKZC2q3lditLtMP9lUOKAIzdd4M2yM,1214
|
|
74
|
-
dbt_platform_helper/templates/pipelines/environments/buildspec.yml,sha256=
|
|
74
|
+
dbt_platform_helper/templates/pipelines/environments/buildspec.yml,sha256=hTCUhSfrnTUMOpUo8EjQmvit2aX7J0cKNeqV2DChaA0,3365
|
|
75
75
|
dbt_platform_helper/templates/pipelines/environments/manifest.yml,sha256=UyHL6wH2mznldZIyjPSbG72yO6zErglNcaoliHOKYvM,1765
|
|
76
76
|
dbt_platform_helper/templates/pipelines/environments/overrides/cfn.patches.yml,sha256=VLjm3Dz4clUz44B5RSQy7mu1sRzm7Yf2S_TSnor_b_k,638
|
|
77
77
|
dbt_platform_helper/templates/svc/maintenance_pages/default.html,sha256=OTZ-qwwSXu7PFbsgp4kppdm1lsg_iHK7FCFqhPnvrEs,741
|
|
@@ -94,10 +94,10 @@ dbt_platform_helper/utils/messages.py,sha256=aLx6s9utt__IqlDdeIYq4n82ERwludu2Zfq
|
|
|
94
94
|
dbt_platform_helper/utils/platform_config.py,sha256=dEGB6peHB1ywYSdS71JGxbWIuTFRaeQfWelksX9v6bQ,608
|
|
95
95
|
dbt_platform_helper/utils/template.py,sha256=raRx4QUCVJtKfvJK08Egg6gwWcs3r3V4nPWcJW4xNhA,574
|
|
96
96
|
dbt_platform_helper/utils/validation.py,sha256=OPajVss8pWth_3FD_1iPodNjeysTZ28-dMEvMRc4I1c,22735
|
|
97
|
-
dbt_platform_helper/utils/versioning.py,sha256=
|
|
97
|
+
dbt_platform_helper/utils/versioning.py,sha256=h3veQpFoiOjYY9dRVppcBDzVfgZerT0lXuE9QCTo5-c,10710
|
|
98
98
|
platform_helper.py,sha256=zjsZKcbyrEQbKfERi0JG8JEL-MgG6EjxIMiWT66kCVg,2299
|
|
99
|
-
dbt_platform_helper-10.7.
|
|
100
|
-
dbt_platform_helper-10.7.
|
|
101
|
-
dbt_platform_helper-10.7.
|
|
102
|
-
dbt_platform_helper-10.7.
|
|
103
|
-
dbt_platform_helper-10.7.
|
|
99
|
+
dbt_platform_helper-10.7.3.dist-info/LICENSE,sha256=dP79lN73--7LMApnankTGLqDbImXg8iYFqWgnExGkGk,1090
|
|
100
|
+
dbt_platform_helper-10.7.3.dist-info/METADATA,sha256=NJLVOvf-JsUx9NgqkzrNjVlrz4a8Cr3jyBA9Wc1ripw,3126
|
|
101
|
+
dbt_platform_helper-10.7.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
102
|
+
dbt_platform_helper-10.7.3.dist-info/entry_points.txt,sha256=QhbY8F434A-onsg0-FsdMd2U6HKh6Q7yCFFZrGUh5-M,67
|
|
103
|
+
dbt_platform_helper-10.7.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.7.1.dist-info → dbt_platform_helper-10.7.3.dist-info}/entry_points.txt
RENAMED
|
File without changes
|