dbt-platform-helper 13.0.1__py3-none-any.whl → 13.1.0__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.
- dbt_platform_helper/COMMANDS.md +2 -2
- dbt_platform_helper/commands/config.py +26 -33
- dbt_platform_helper/commands/copilot.py +1 -1
- dbt_platform_helper/commands/environment.py +1 -1
- dbt_platform_helper/commands/generate.py +2 -2
- dbt_platform_helper/commands/pipeline.py +1 -1
- dbt_platform_helper/commands/version.py +30 -30
- dbt_platform_helper/domain/copilot_environment.py +11 -10
- dbt_platform_helper/domain/database_copy.py +1 -1
- dbt_platform_helper/domain/maintenance_page.py +32 -7
- dbt_platform_helper/domain/pipelines.py +17 -1
- dbt_platform_helper/domain/terraform_environment.py +17 -61
- dbt_platform_helper/providers/config.py +12 -2
- dbt_platform_helper/{domain → providers}/config_validator.py +10 -5
- dbt_platform_helper/providers/files.py +13 -12
- dbt_platform_helper/providers/platform_config_schema.py +18 -13
- dbt_platform_helper/providers/semantic_version.py +126 -0
- dbt_platform_helper/providers/terraform_manifest.py +126 -29
- dbt_platform_helper/providers/validation.py +0 -14
- dbt_platform_helper/providers/version.py +36 -0
- dbt_platform_helper/providers/yaml_file.py +5 -3
- dbt_platform_helper/templates/environment-pipelines/main.tf +1 -1
- dbt_platform_helper/utils/application.py +3 -2
- dbt_platform_helper/utils/validation.py +1 -1
- dbt_platform_helper/utils/versioning.py +152 -225
- {dbt_platform_helper-13.0.1.dist-info → dbt_platform_helper-13.1.0.dist-info}/METADATA +1 -1
- {dbt_platform_helper-13.0.1.dist-info → dbt_platform_helper-13.1.0.dist-info}/RECORD +31 -32
- {dbt_platform_helper-13.0.1.dist-info → dbt_platform_helper-13.1.0.dist-info}/WHEEL +1 -1
- platform_helper.py +2 -2
- dbt_platform_helper/domain/test_platform_terraform_manifest_generator.py +0 -100
- dbt_platform_helper/templates/environments/main.tf +0 -46
- dbt_platform_helper/utils/platform_config.py +0 -20
- {dbt_platform_helper-13.0.1.dist-info → dbt_platform_helper-13.1.0.dist-info}/LICENSE +0 -0
- {dbt_platform_helper-13.0.1.dist-info → dbt_platform_helper-13.1.0.dist-info}/entry_points.txt +0 -0
|
@@ -4,142 +4,114 @@ import subprocess
|
|
|
4
4
|
from importlib.metadata import PackageNotFoundError
|
|
5
5
|
from importlib.metadata import version
|
|
6
6
|
from pathlib import Path
|
|
7
|
-
from typing import Optional
|
|
8
|
-
from typing import Tuple
|
|
9
|
-
from typing import Union
|
|
10
|
-
|
|
11
|
-
import click
|
|
12
|
-
import requests
|
|
13
7
|
|
|
14
8
|
from dbt_platform_helper.constants import DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION
|
|
15
|
-
from dbt_platform_helper.constants import PLATFORM_CONFIG_FILE
|
|
16
9
|
from dbt_platform_helper.constants import PLATFORM_HELPER_VERSION_FILE
|
|
17
|
-
from dbt_platform_helper.
|
|
18
|
-
from dbt_platform_helper.providers.
|
|
10
|
+
from dbt_platform_helper.platform_exception import PlatformException
|
|
11
|
+
from dbt_platform_helper.providers.config import ConfigProvider
|
|
12
|
+
from dbt_platform_helper.providers.io import ClickIOProvider
|
|
13
|
+
from dbt_platform_helper.providers.semantic_version import (
|
|
14
|
+
IncompatibleMajorVersionException,
|
|
15
|
+
)
|
|
16
|
+
from dbt_platform_helper.providers.semantic_version import (
|
|
17
|
+
IncompatibleMinorVersionException,
|
|
18
|
+
)
|
|
19
|
+
from dbt_platform_helper.providers.semantic_version import PlatformHelperVersionStatus
|
|
20
|
+
from dbt_platform_helper.providers.semantic_version import SemanticVersion
|
|
21
|
+
from dbt_platform_helper.providers.semantic_version import VersionStatus
|
|
19
22
|
from dbt_platform_helper.providers.validation import ValidationException
|
|
20
|
-
from dbt_platform_helper.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class Versions:
|
|
26
|
-
def __init__(self, local_version: VersionTuple = None, latest_release: VersionTuple = None):
|
|
27
|
-
self.local_version = local_version
|
|
28
|
-
self.latest_release = latest_release
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
class PlatformHelperVersions:
|
|
32
|
-
def __init__(
|
|
33
|
-
self,
|
|
34
|
-
local_version: VersionTuple = None,
|
|
35
|
-
latest_release: VersionTuple = None,
|
|
36
|
-
platform_helper_file_version: VersionTuple = None,
|
|
37
|
-
platform_config_default: VersionTuple = None,
|
|
38
|
-
pipeline_overrides: dict[str, str] = None,
|
|
39
|
-
):
|
|
40
|
-
self.local_version = local_version
|
|
41
|
-
self.latest_release = latest_release
|
|
42
|
-
self.platform_helper_file_version = platform_helper_file_version
|
|
43
|
-
self.platform_config_default = platform_config_default
|
|
44
|
-
self.pipeline_overrides = pipeline_overrides if pipeline_overrides else {}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def string_version(input_version: VersionTuple) -> str:
|
|
48
|
-
if input_version is None:
|
|
49
|
-
return "unknown"
|
|
50
|
-
major, minor, patch = input_version
|
|
51
|
-
return ".".join([str(s) for s in [major, minor, patch]])
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
def parse_version(input_version: Union[str, None]) -> VersionTuple:
|
|
55
|
-
if input_version is None:
|
|
56
|
-
return None
|
|
57
|
-
|
|
58
|
-
version_plain = input_version.replace("v", "")
|
|
59
|
-
version_segments = re.split(r"[.\-]", version_plain)
|
|
60
|
-
|
|
61
|
-
if len(version_segments) != 3:
|
|
62
|
-
return None
|
|
63
|
-
|
|
64
|
-
output_version = [0, 0, 0]
|
|
65
|
-
for index, segment in enumerate(version_segments):
|
|
66
|
-
try:
|
|
67
|
-
output_version[index] = int(segment)
|
|
68
|
-
except ValueError:
|
|
69
|
-
output_version[index] = -1
|
|
70
|
-
return output_version[0], output_version[1], output_version[2]
|
|
23
|
+
from dbt_platform_helper.providers.version import GithubVersionProvider
|
|
24
|
+
from dbt_platform_helper.providers.version import PyPiVersionProvider
|
|
25
|
+
from dbt_platform_helper.providers.yaml_file import FileProviderException
|
|
26
|
+
from dbt_platform_helper.providers.yaml_file import YamlFileProvider
|
|
71
27
|
|
|
72
28
|
|
|
73
|
-
|
|
74
|
-
|
|
29
|
+
class PlatformHelperVersionNotFoundException(PlatformException):
|
|
30
|
+
def __init__(self):
|
|
31
|
+
super().__init__(f"""Platform helper version could not be resolved.""")
|
|
75
32
|
|
|
76
|
-
try:
|
|
77
|
-
response = subprocess.run("copilot --version", capture_output=True, shell=True)
|
|
78
|
-
[copilot_version] = re.findall(r"[0-9.]+", response.stdout.decode("utf8"))
|
|
79
|
-
except ValueError:
|
|
80
|
-
pass
|
|
81
33
|
|
|
82
|
-
|
|
34
|
+
class RequiredVersion:
|
|
35
|
+
def __init__(self, io=None):
|
|
36
|
+
self.io = io or ClickIOProvider()
|
|
83
37
|
|
|
38
|
+
def get_required_platform_helper_version(
|
|
39
|
+
self, pipeline: str = None, versions: PlatformHelperVersionStatus = None
|
|
40
|
+
) -> str:
|
|
41
|
+
if not versions:
|
|
42
|
+
versions = get_platform_helper_versions()
|
|
43
|
+
pipeline_version = versions.pipeline_overrides.get(pipeline)
|
|
44
|
+
version_precedence = [
|
|
45
|
+
pipeline_version,
|
|
46
|
+
versions.platform_config_default,
|
|
47
|
+
versions.deprecated_version_file,
|
|
48
|
+
]
|
|
49
|
+
non_null_version_precedence = [
|
|
50
|
+
f"{v}" if isinstance(v, SemanticVersion) else v for v in version_precedence if v
|
|
51
|
+
]
|
|
84
52
|
|
|
85
|
-
|
|
86
|
-
aws_version = None
|
|
87
|
-
try:
|
|
88
|
-
response = subprocess.run("aws --version", capture_output=True, shell=True)
|
|
89
|
-
matched = re.match(r"aws-cli/([0-9.]+)", response.stdout.decode("utf8"))
|
|
90
|
-
aws_version = parse_version(matched.group(1))
|
|
91
|
-
except ValueError:
|
|
92
|
-
pass
|
|
53
|
+
out = non_null_version_precedence[0] if non_null_version_precedence else None
|
|
93
54
|
|
|
94
|
-
|
|
55
|
+
if not out:
|
|
56
|
+
raise PlatformHelperVersionNotFoundException
|
|
95
57
|
|
|
58
|
+
return out
|
|
96
59
|
|
|
97
|
-
def
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
versions.sort(reverse=True)
|
|
102
|
-
return versions[0]
|
|
60
|
+
def get_required_version(self, pipeline=None):
|
|
61
|
+
version = self.get_required_platform_helper_version(pipeline)
|
|
62
|
+
self.io.info(version)
|
|
63
|
+
return version
|
|
103
64
|
|
|
104
|
-
|
|
105
|
-
|
|
65
|
+
# Used in the generate command
|
|
66
|
+
def check_platform_helper_version_mismatch(self):
|
|
67
|
+
if not running_as_installed_package():
|
|
68
|
+
return
|
|
106
69
|
|
|
70
|
+
versions = get_platform_helper_versions()
|
|
71
|
+
platform_helper_file_version = SemanticVersion.from_string(
|
|
72
|
+
self.get_required_platform_helper_version(versions=versions)
|
|
73
|
+
)
|
|
107
74
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
75
|
+
if not versions.local == platform_helper_file_version:
|
|
76
|
+
message = (
|
|
77
|
+
f"WARNING: You are running platform-helper v{versions.local} against "
|
|
78
|
+
f"v{platform_helper_file_version} specified by {PLATFORM_HELPER_VERSION_FILE}."
|
|
79
|
+
)
|
|
80
|
+
self.io.warn(message)
|
|
114
81
|
|
|
115
82
|
|
|
116
|
-
|
|
83
|
+
# Resolves all the versions from pypi, config and locally installed version
|
|
84
|
+
# echos warnings if anything is incompatible
|
|
85
|
+
def get_platform_helper_versions(
|
|
86
|
+
include_project_versions=True, yaml_provider=YamlFileProvider
|
|
87
|
+
) -> PlatformHelperVersionStatus:
|
|
117
88
|
try:
|
|
118
|
-
locally_installed_version =
|
|
89
|
+
locally_installed_version = SemanticVersion.from_string(version("dbt-platform-helper"))
|
|
119
90
|
except PackageNotFoundError:
|
|
120
91
|
locally_installed_version = None
|
|
121
92
|
|
|
122
|
-
latest_release =
|
|
93
|
+
latest_release = PyPiVersionProvider.get_latest_version("dbt-platform-helper")
|
|
123
94
|
|
|
124
95
|
if not include_project_versions:
|
|
125
|
-
return
|
|
126
|
-
|
|
127
|
-
|
|
96
|
+
return PlatformHelperVersionStatus(
|
|
97
|
+
local=locally_installed_version,
|
|
98
|
+
latest=latest_release,
|
|
128
99
|
)
|
|
129
100
|
|
|
130
101
|
deprecated_version_file = Path(PLATFORM_HELPER_VERSION_FILE)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
102
|
+
try:
|
|
103
|
+
loaded_version = yaml_provider.load(deprecated_version_file)
|
|
104
|
+
version_from_file = SemanticVersion.from_string(loaded_version)
|
|
105
|
+
except FileProviderException:
|
|
106
|
+
version_from_file = None
|
|
136
107
|
|
|
137
108
|
platform_config_default, pipeline_overrides = None, {}
|
|
138
109
|
|
|
139
|
-
|
|
110
|
+
config = ConfigProvider()
|
|
111
|
+
platform_config = config.load_unvalidated_config_file()
|
|
140
112
|
|
|
141
113
|
if platform_config:
|
|
142
|
-
platform_config_default =
|
|
114
|
+
platform_config_default = SemanticVersion.from_string(
|
|
143
115
|
platform_config.get("default_versions", {}).get("platform-helper")
|
|
144
116
|
)
|
|
145
117
|
|
|
@@ -149,10 +121,10 @@ def get_platform_helper_versions(include_project_versions=True) -> PlatformHelpe
|
|
|
149
121
|
if pipeline.get("versions", {}).get("platform-helper")
|
|
150
122
|
}
|
|
151
123
|
|
|
152
|
-
out =
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
124
|
+
out = PlatformHelperVersionStatus(
|
|
125
|
+
local=locally_installed_version,
|
|
126
|
+
latest=latest_release,
|
|
127
|
+
deprecated_version_file=version_from_file,
|
|
156
128
|
platform_config_default=platform_config_default,
|
|
157
129
|
pipeline_overrides=pipeline_overrides,
|
|
158
130
|
)
|
|
@@ -162,150 +134,105 @@ def get_platform_helper_versions(include_project_versions=True) -> PlatformHelpe
|
|
|
162
134
|
return out
|
|
163
135
|
|
|
164
136
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
if versions.platform_config_default and versions.platform_helper_file_version:
|
|
171
|
-
messages.append(deprecation_message)
|
|
137
|
+
# Validates the returned PlatformHelperVersionStatus and echos useful warnings
|
|
138
|
+
# Could return ValidationMessages (warnings and errors) which are output elsewhere
|
|
139
|
+
def _process_version_file_warnings(versions: PlatformHelperVersionStatus, io=ClickIOProvider()):
|
|
140
|
+
messages = versions.warn()
|
|
172
141
|
|
|
173
|
-
if
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
if not versions.platform_config_default and versions.platform_helper_file_version:
|
|
177
|
-
messages.append(deprecation_message)
|
|
178
|
-
messages.append(
|
|
179
|
-
f"{missing_default_version_message}{string_version(versions.platform_helper_file_version)}\n"
|
|
180
|
-
)
|
|
142
|
+
if messages.get("errors"):
|
|
143
|
+
io.error("\n".join(messages["errors"]))
|
|
181
144
|
|
|
182
|
-
if
|
|
183
|
-
|
|
184
|
-
message += f"{missing_default_version_message}{string_version(versions.local_version)}\n"
|
|
185
|
-
click.secho(message, fg="red")
|
|
145
|
+
if messages.get("warnings"):
|
|
146
|
+
io.warn("\n".join(messages["warnings"]))
|
|
186
147
|
|
|
187
|
-
if messages:
|
|
188
|
-
click.secho("\n".join(messages), fg="yellow")
|
|
189
148
|
|
|
149
|
+
# TODO called at the beginning of every command. This is platform-version base functionality
|
|
150
|
+
def check_platform_helper_version_needs_update(io=ClickIOProvider()):
|
|
151
|
+
if not running_as_installed_package() or "PLATFORM_TOOLS_SKIP_VERSION_CHECK" in os.environ:
|
|
152
|
+
return
|
|
153
|
+
versions = get_platform_helper_versions(include_project_versions=False)
|
|
154
|
+
local_version = versions.local
|
|
155
|
+
latest_release = versions.latest
|
|
156
|
+
message = (
|
|
157
|
+
f"You are running platform-helper v{local_version}, upgrade to "
|
|
158
|
+
f"v{latest_release} by running run `pip install "
|
|
159
|
+
"--upgrade dbt-platform-helper`."
|
|
160
|
+
)
|
|
161
|
+
try:
|
|
162
|
+
local_version.validate_compatibility_with(latest_release)
|
|
163
|
+
except IncompatibleMajorVersionException:
|
|
164
|
+
io.error(message)
|
|
165
|
+
except IncompatibleMinorVersionException:
|
|
166
|
+
io.warn(message)
|
|
190
167
|
|
|
191
|
-
def validate_version_compatibility(
|
|
192
|
-
app_version: Tuple[int, int, int], check_version: Tuple[int, int, int]
|
|
193
|
-
):
|
|
194
|
-
app_major, app_minor, app_patch = app_version
|
|
195
|
-
check_major, check_minor, check_patch = check_version
|
|
196
|
-
app_version_as_string = string_version(app_version)
|
|
197
|
-
check_version_as_string = string_version(check_version)
|
|
198
|
-
|
|
199
|
-
if (app_major == 0 and check_major == 0) and (
|
|
200
|
-
app_minor != check_minor or app_patch != check_patch
|
|
201
|
-
):
|
|
202
|
-
raise IncompatibleMajorVersionException(app_version_as_string, check_version_as_string)
|
|
203
|
-
|
|
204
|
-
if app_major != check_major:
|
|
205
|
-
raise IncompatibleMajorVersionException(app_version_as_string, check_version_as_string)
|
|
206
168
|
|
|
207
|
-
|
|
208
|
-
|
|
169
|
+
# TODO can stay as utility for now
|
|
170
|
+
def running_as_installed_package():
|
|
171
|
+
return "site-packages" in __file__
|
|
209
172
|
|
|
210
173
|
|
|
211
|
-
def
|
|
212
|
-
|
|
174
|
+
def get_required_terraform_platform_modules_version(
|
|
175
|
+
cli_terraform_platform_modules_version, platform_config_terraform_modules_default_version
|
|
213
176
|
):
|
|
214
|
-
|
|
215
|
-
|
|
177
|
+
version_preference_order = [
|
|
178
|
+
cli_terraform_platform_modules_version,
|
|
179
|
+
platform_config_terraform_modules_default_version,
|
|
180
|
+
DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION,
|
|
181
|
+
]
|
|
182
|
+
return [version for version in version_preference_order if version][0]
|
|
216
183
|
|
|
217
|
-
return app_major == file_major and app_minor == file_minor and app_patch == file_patch
|
|
218
184
|
|
|
185
|
+
#########################################
|
|
186
|
+
# Only used in Config domain
|
|
187
|
+
# TODO to be relocated along with tests
|
|
188
|
+
#########################################
|
|
219
189
|
|
|
220
|
-
|
|
190
|
+
|
|
191
|
+
# Getting version from the "Generated by" comment in a file that was generated from a template
|
|
192
|
+
# TODO where does this belong? It sort of belongs to our platform-helper templating
|
|
193
|
+
def get_template_generated_with_version(template_file_path: str) -> SemanticVersion:
|
|
221
194
|
try:
|
|
222
195
|
template_contents = Path(template_file_path).read_text()
|
|
223
196
|
template_version = re.match(
|
|
224
197
|
r"# Generated by platform-helper ([v.\-0-9]+)", template_contents
|
|
225
198
|
).group(1)
|
|
226
|
-
return
|
|
199
|
+
return SemanticVersion.from_string(template_version)
|
|
227
200
|
except (IndexError, AttributeError):
|
|
228
201
|
raise ValidationException(f"Template {template_file_path} has no version information")
|
|
229
202
|
|
|
230
203
|
|
|
231
|
-
def validate_template_version(app_version:
|
|
232
|
-
|
|
233
|
-
app_version,
|
|
234
|
-
get_template_generated_with_version(template_file_path),
|
|
235
|
-
)
|
|
204
|
+
def validate_template_version(app_version: SemanticVersion, template_file_path: str):
|
|
205
|
+
app_version.validate_compatibility_with(get_template_generated_with_version(template_file_path))
|
|
236
206
|
|
|
237
207
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
208
|
+
# Local version and latest release of tool.
|
|
209
|
+
# Used only in config command.
|
|
210
|
+
# TODO Move to config domain
|
|
211
|
+
def get_copilot_versions() -> VersionStatus:
|
|
212
|
+
copilot_version = None
|
|
241
213
|
|
|
242
|
-
versions = get_platform_helper_versions(include_project_versions=False)
|
|
243
|
-
local_version = versions.local_version
|
|
244
|
-
latest_release = versions.latest_release
|
|
245
|
-
message = (
|
|
246
|
-
f"You are running platform-helper v{string_version(local_version)}, upgrade to "
|
|
247
|
-
f"v{string_version(latest_release)} by running run `pip install "
|
|
248
|
-
"--upgrade dbt-platform-helper`."
|
|
249
|
-
)
|
|
250
214
|
try:
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
click.secho(message, fg="yellow")
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
def check_platform_helper_version_mismatch():
|
|
259
|
-
if not running_as_installed_package():
|
|
260
|
-
return
|
|
215
|
+
response = subprocess.run("copilot --version", capture_output=True, shell=True)
|
|
216
|
+
[copilot_version] = re.findall(r"[0-9.]+", response.stdout.decode("utf8"))
|
|
217
|
+
except ValueError:
|
|
218
|
+
pass
|
|
261
219
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
get_required_platform_helper_version(versions=versions)
|
|
220
|
+
return VersionStatus(
|
|
221
|
+
SemanticVersion.from_string(copilot_version),
|
|
222
|
+
GithubVersionProvider.get_latest_version("aws/copilot-cli"),
|
|
266
223
|
)
|
|
267
224
|
|
|
268
|
-
if not check_version_on_file_compatibility(local_version, platform_helper_file_version):
|
|
269
|
-
message = (
|
|
270
|
-
f"WARNING: You are running platform-helper v{string_version(local_version)} against "
|
|
271
|
-
f"v{string_version(platform_helper_file_version)} specified by {PLATFORM_HELPER_VERSION_FILE}."
|
|
272
|
-
)
|
|
273
|
-
click.secho(message, fg="red")
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
def running_as_installed_package():
|
|
277
|
-
return "site-packages" in __file__
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
def get_required_platform_helper_version(
|
|
281
|
-
pipeline: str = None, versions: PlatformHelperVersions = None
|
|
282
|
-
) -> str:
|
|
283
|
-
if not versions:
|
|
284
|
-
versions = get_platform_helper_versions()
|
|
285
|
-
pipeline_version = versions.pipeline_overrides.get(pipeline)
|
|
286
|
-
version_precedence = [
|
|
287
|
-
pipeline_version,
|
|
288
|
-
versions.platform_config_default,
|
|
289
|
-
versions.platform_helper_file_version,
|
|
290
|
-
]
|
|
291
|
-
non_null_version_precedence = [
|
|
292
|
-
string_version(v) if isinstance(v, tuple) else v for v in version_precedence if v
|
|
293
|
-
]
|
|
294
|
-
|
|
295
|
-
out = non_null_version_precedence[0] if non_null_version_precedence else None
|
|
296
|
-
|
|
297
|
-
if not out:
|
|
298
|
-
raise SystemExit(1)
|
|
299
|
-
|
|
300
|
-
return out
|
|
301
225
|
|
|
226
|
+
# Local version and latest release of tool.
|
|
227
|
+
# Used only in config command.
|
|
228
|
+
# TODO Move to config domain
|
|
229
|
+
def get_aws_versions() -> VersionStatus:
|
|
230
|
+
aws_version = None
|
|
231
|
+
try:
|
|
232
|
+
response = subprocess.run("aws --version", capture_output=True, shell=True)
|
|
233
|
+
matched = re.match(r"aws-cli/([0-9.]+)", response.stdout.decode("utf8"))
|
|
234
|
+
aws_version = SemanticVersion.from_string(matched.group(1))
|
|
235
|
+
except ValueError:
|
|
236
|
+
pass
|
|
302
237
|
|
|
303
|
-
|
|
304
|
-
cli_terraform_platform_modules_version, platform_config_terraform_modules_default_version
|
|
305
|
-
):
|
|
306
|
-
version_preference_order = [
|
|
307
|
-
cli_terraform_platform_modules_version,
|
|
308
|
-
platform_config_terraform_modules_default_version,
|
|
309
|
-
DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION,
|
|
310
|
-
]
|
|
311
|
-
return [version for version in version_preference_order if version][0]
|
|
238
|
+
return VersionStatus(aws_version, GithubVersionProvider.get_latest_version("aws/aws-cli", True))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: dbt-platform-helper
|
|
3
|
-
Version: 13.0
|
|
3
|
+
Version: 13.1.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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
dbt_platform_helper/COMMANDS.md,sha256=
|
|
1
|
+
dbt_platform_helper/COMMANDS.md,sha256=tBGjnVDw5sXQfCNyHJfFWWu_40LqxbmfIE_SRVhg97g,22644
|
|
2
2
|
dbt_platform_helper/README.md,sha256=B0qN2_u_ASqqgkGDWY2iwNGZt_9tUgMb9XqtaTuzYjw,1530
|
|
3
3
|
dbt_platform_helper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
dbt_platform_helper/addon-plans.yml,sha256=O46a_ODsGG9KXmQY_1XbSGqrpSaHSLDe-SdROzHx8Go,4545
|
|
@@ -6,48 +6,49 @@ dbt_platform_helper/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
|
|
|
6
6
|
dbt_platform_helper/commands/application.py,sha256=eVwCaYuwBlk0zx0xfA6fW7b-S1pl8gkyT1lHKeeh2R0,10147
|
|
7
7
|
dbt_platform_helper/commands/codebase.py,sha256=y2d2flGXv44KPv0Rj18gVrDG5t862OEzIoQiOK0STqw,2375
|
|
8
8
|
dbt_platform_helper/commands/conduit.py,sha256=QYMOYyCxFPzj_NJaXs3flIL7sHjOv75uAqPpjgh-EPo,2320
|
|
9
|
-
dbt_platform_helper/commands/config.py,sha256=
|
|
10
|
-
dbt_platform_helper/commands/copilot.py,sha256=
|
|
9
|
+
dbt_platform_helper/commands/config.py,sha256=YdwcR6u3qLM3afeZAAcKr8cqTzIgD7-rT0WdE9g2F0c,11548
|
|
10
|
+
dbt_platform_helper/commands/copilot.py,sha256=crnJeL4IcI2ApU7YWG6hBZ1CGjuQD6jBrr0fATJqSrI,13626
|
|
11
11
|
dbt_platform_helper/commands/database.py,sha256=aG3zcMHL5PE96b7LSAu0FGCbgcycQej3AGRcd-bpXUo,4115
|
|
12
|
-
dbt_platform_helper/commands/environment.py,sha256=
|
|
13
|
-
dbt_platform_helper/commands/generate.py,sha256=
|
|
12
|
+
dbt_platform_helper/commands/environment.py,sha256=KzXe4ai9aD-Go4eN2k5K8ZKY48dKVeE7mp84_grpua0,3912
|
|
13
|
+
dbt_platform_helper/commands/generate.py,sha256=gModp-iOR528t631GYCYx4CXXvpcPco1MzIFIB9eQxA,717
|
|
14
14
|
dbt_platform_helper/commands/notify.py,sha256=lCS_JotQeg4NEpF4x145TCoZs0Pnf_LYf0rB1Iz_Tw0,3884
|
|
15
|
-
dbt_platform_helper/commands/pipeline.py,sha256=
|
|
15
|
+
dbt_platform_helper/commands/pipeline.py,sha256=g7aWzvU6Z_l7N42n12ls9yAz8VqHLENPWFI-zo-J1-w,3003
|
|
16
16
|
dbt_platform_helper/commands/secrets.py,sha256=QjF9xUChioIr_P0fzqwyEcqLvcN-RNZmNFFlaUPVU9o,3994
|
|
17
|
-
dbt_platform_helper/commands/version.py,sha256=
|
|
17
|
+
dbt_platform_helper/commands/version.py,sha256=P030Z6lcsXxqlMt3ZijyAgfrKD4wq9xKTyFWolqiNJQ,1357
|
|
18
18
|
dbt_platform_helper/constants.py,sha256=DpHGG54lwjw3XGp2TKCEGNmzaz083lAWMGkEabujDrw,1050
|
|
19
19
|
dbt_platform_helper/default-extensions.yml,sha256=SU1ZitskbuEBpvE7efc3s56eAUF11j70brhj_XrNMMo,493
|
|
20
20
|
dbt_platform_helper/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
21
|
dbt_platform_helper/domain/codebase.py,sha256=bLlTRqYmIz8J7W4siQczIJIt4Lc5-bjy-Qo46EyovFw,10496
|
|
22
22
|
dbt_platform_helper/domain/conduit.py,sha256=5C5GnF5jssJ1rFFCY6qaKgvLjYUkyytRJE4tHlanYa0,4370
|
|
23
|
-
dbt_platform_helper/domain/
|
|
24
|
-
dbt_platform_helper/domain/
|
|
25
|
-
dbt_platform_helper/domain/
|
|
26
|
-
dbt_platform_helper/domain/
|
|
27
|
-
dbt_platform_helper/domain/
|
|
28
|
-
dbt_platform_helper/domain/terraform_environment.py,sha256=GsGPc3ufk3wxj7zYq6xkcnmspMI1EIaiQTFjD_HFS-8,3324
|
|
29
|
-
dbt_platform_helper/domain/test_platform_terraform_manifest_generator.py,sha256=DvDlTeLGJfiAJKshBJKe9SZm4uMSOR7MMUPy37rUwKE,4325
|
|
23
|
+
dbt_platform_helper/domain/copilot_environment.py,sha256=m6FBduekUR5XLIXcqW26lXif9jF4168f03UxCABaKbI,8947
|
|
24
|
+
dbt_platform_helper/domain/database_copy.py,sha256=CKvI9LsHyowg0bPT9jImk07w4TyQLPoInQoU2TUDiJQ,9485
|
|
25
|
+
dbt_platform_helper/domain/maintenance_page.py,sha256=aV1Fv3APyBakIxpMExeWwB6kk33HFc0tJyjeyRalkOA,20349
|
|
26
|
+
dbt_platform_helper/domain/pipelines.py,sha256=d5QF9iayFPEeqLuo6ztiGoAN_gLaMV91ps9JoGiAAUI,6498
|
|
27
|
+
dbt_platform_helper/domain/terraform_environment.py,sha256=pyUWIxvMESbyp4yAq715JXKKHW133tr1vwxi2cMK5MI,1754
|
|
30
28
|
dbt_platform_helper/jinja2_tags.py,sha256=hKG6RS3zlxJHQ-Op9r2U2-MhWp4s3lZir4Ihe24ApJ0,540
|
|
31
29
|
dbt_platform_helper/platform_exception.py,sha256=bheZV9lqGvrCVTNT92349dVntNDEDWTEwciZgC83WzE,187
|
|
32
30
|
dbt_platform_helper/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
31
|
dbt_platform_helper/providers/aws.py,sha256=mlorH0fni6m8aUpm1x2jQPhaI3T0QsDMWpoGiSURBcI,1387
|
|
34
32
|
dbt_platform_helper/providers/cache.py,sha256=GIFVdpfXVnVgf2POQvBvZDP6pvYeUFjEuAdAQLbhJXs,2563
|
|
35
33
|
dbt_platform_helper/providers/cloudformation.py,sha256=SvCZgEVqxdpKfQMRAG3KzFQ43YeOEDqMm2tKmFGtacY,5347
|
|
36
|
-
dbt_platform_helper/providers/config.py,sha256=
|
|
34
|
+
dbt_platform_helper/providers/config.py,sha256=nGpL2_-ko94Dd4YM5vDEpME_8IGEhWpFcLQqKkb_h8E,4145
|
|
35
|
+
dbt_platform_helper/providers/config_validator.py,sha256=of2iD4JX69Ekvs1CbAHU-KHsg9aVUgyB5uHkeYsGGlQ,10722
|
|
37
36
|
dbt_platform_helper/providers/copilot.py,sha256=nBbt-PoGXVkmb9njJti6Et8dq1W9GytW3jGBydNNYYU,5317
|
|
38
37
|
dbt_platform_helper/providers/ecr.py,sha256=lmLKGR5OQT8EyGsX-9M7oO0DHIyoMqgchBAVQBeoBZs,639
|
|
39
38
|
dbt_platform_helper/providers/ecs.py,sha256=XlQHYhZiLGrqR-1ZWMagGH2R2Hy7mCP6676eZL3YbNQ,3842
|
|
40
|
-
dbt_platform_helper/providers/files.py,sha256=
|
|
39
|
+
dbt_platform_helper/providers/files.py,sha256=cJdOV6Eupi-COmGUMxZMF10BZnMi3MCCipTVUnE_NPA,857
|
|
41
40
|
dbt_platform_helper/providers/io.py,sha256=JkWNIMZ_lcYQ6XvdVAuwtTZjoFIPJ-84zbH09nWLMdk,816
|
|
42
41
|
dbt_platform_helper/providers/load_balancers.py,sha256=Q2h4UT4KVA9E7q55Q4HGKxLlvMtpOXdR-KWQJSqTfm0,2746
|
|
43
42
|
dbt_platform_helper/providers/opensearch.py,sha256=tp64jTzHlutleqMpi2h_ZKH1iakZPJnUODebX6i2mfA,1335
|
|
44
|
-
dbt_platform_helper/providers/platform_config_schema.py,sha256=
|
|
43
|
+
dbt_platform_helper/providers/platform_config_schema.py,sha256=MDZsDi8bSXkjctmXRgZCCvQY3HtaRJAU5shAx3wWxjc,26725
|
|
45
44
|
dbt_platform_helper/providers/redis.py,sha256=aj8pitxG9IKrMkL3fIYayQhcHPPzApdaXq0Uq_0yblg,1217
|
|
46
45
|
dbt_platform_helper/providers/secrets.py,sha256=6cYIR15dLdHmqxtWQpM6R71e0_Xgsg9V291HBG-0LV0,5272
|
|
47
|
-
dbt_platform_helper/providers/
|
|
48
|
-
dbt_platform_helper/providers/
|
|
46
|
+
dbt_platform_helper/providers/semantic_version.py,sha256=r6EWSzzCHswblzKo4_QyBR4rrR_CUo95NF6eialoiIQ,4395
|
|
47
|
+
dbt_platform_helper/providers/terraform_manifest.py,sha256=hrCjkuQIV0Ymt5MPLkh-BfXHtuAScXhWwNkVEp9K5Jg,9354
|
|
48
|
+
dbt_platform_helper/providers/validation.py,sha256=i2g-Mrd4hy_fGIfGa6ZQy4vTJ40OM44Fe_XpEifGWxs,126
|
|
49
|
+
dbt_platform_helper/providers/version.py,sha256=BvQo5dKHlaUVNgXagnYUtbATafkxtvpz2wfDVsNfyno,1335
|
|
49
50
|
dbt_platform_helper/providers/vpc.py,sha256=EIjjD71K1Ry3V1jyaAkAjZwlwu_FSTn-AS7kiJFiipA,2953
|
|
50
|
-
dbt_platform_helper/providers/yaml_file.py,sha256=
|
|
51
|
+
dbt_platform_helper/providers/yaml_file.py,sha256=D4ESXYBdryT4kJ7Jr3koL05c5Lbn6fFv1YReImrYKQo,2180
|
|
51
52
|
dbt_platform_helper/templates/.copilot/config.yml,sha256=J_bA9sCtBdCPBRImpCBRnYvhQd4vpLYIXIU-lq9vbkA,158
|
|
52
53
|
dbt_platform_helper/templates/.copilot/image_build_run.sh,sha256=adYucYXEB-kAgZNjTQo0T6EIAY8sh_xCEvVhWKKQ8mw,164
|
|
53
54
|
dbt_platform_helper/templates/.copilot/phases/build.sh,sha256=umKXePcRvx4XyrRY0fAWIyYFtNjqBI2L8vIJk-V7C60,121
|
|
@@ -67,8 +68,7 @@ dbt_platform_helper/templates/create-codebuild-role.json,sha256=THJgIKi8rWwDzhg5
|
|
|
67
68
|
dbt_platform_helper/templates/custom-codebuild-role-policy.json,sha256=8xyCofilPhV1Yjt3OnQLcI2kZ35mk2c07GcqYrKxuoI,1180
|
|
68
69
|
dbt_platform_helper/templates/env/manifest.yml,sha256=VCEj_y3jdfnPYi6gmyrwiEqzHYjpaJDANbvswmkiLA0,802
|
|
69
70
|
dbt_platform_helper/templates/env/terraform-overrides/cfn.patches.yml,sha256=cFlg69fvi9kzpz13ZAeY1asseZ6TuUex-6s76jG3oL4,259
|
|
70
|
-
dbt_platform_helper/templates/environment-pipelines/main.tf,sha256=
|
|
71
|
-
dbt_platform_helper/templates/environments/main.tf,sha256=0Zqi42IoqB25kWEbnBwoyxDM6-N4xRp2EYWgVJJSCWw,1537
|
|
71
|
+
dbt_platform_helper/templates/environment-pipelines/main.tf,sha256=qElclUHb0pv-N7yDuIWxryz3jpjoArMn8cuN2_V63xw,1944
|
|
72
72
|
dbt_platform_helper/templates/svc/maintenance_pages/default.html,sha256=OTZ-qwwSXu7PFbsgp4kppdm1lsg_iHK7FCFqhPnvrEs,741
|
|
73
73
|
dbt_platform_helper/templates/svc/maintenance_pages/dmas-migration.html,sha256=qvI6tHuI0UQbMBCuvPgK1a_zLANB6w7KVo9N5d8r-i0,829
|
|
74
74
|
dbt_platform_helper/templates/svc/maintenance_pages/migration.html,sha256=GiQsOiuaMFb7jG5_wU3V7BMcByHBl9fOBgrNf8quYlw,783
|
|
@@ -76,7 +76,7 @@ dbt_platform_helper/templates/svc/manifest-backend.yml,sha256=aAD9ndkbXnF7JBAKS2
|
|
|
76
76
|
dbt_platform_helper/templates/svc/manifest-public.yml,sha256=6NHVR_onBu5hbwynLrB6roDRce7JcylSc0qeYvzlPdI,3664
|
|
77
77
|
dbt_platform_helper/templates/svc/overrides/cfn.patches.yml,sha256=W7-d017akuUq9kda64DQxazavcRcCPDjaAik6t1EZqM,742
|
|
78
78
|
dbt_platform_helper/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
79
|
-
dbt_platform_helper/utils/application.py,sha256=
|
|
79
|
+
dbt_platform_helper/utils/application.py,sha256=sKJG5vjEJyUZJXnqM3NeZS228SKuv9dvK0EGaWpb0sg,4826
|
|
80
80
|
dbt_platform_helper/utils/arn_parser.py,sha256=BaXzIxSOLdFmP_IfAxRq-0j-0Re1iCN7L4j2Zi5-CRQ,1304
|
|
81
81
|
dbt_platform_helper/utils/aws.py,sha256=C18qEs8rekApGpJ39UslPvmpdFKhKX8Pybvz62YslQU,16918
|
|
82
82
|
dbt_platform_helper/utils/click.py,sha256=Fx4y4bbve1zypvog_sgK7tJtCocmzheoEFLBRv1lfdM,2943
|
|
@@ -85,13 +85,12 @@ dbt_platform_helper/utils/files.py,sha256=adQtG2E1IQHDKfeX06l6j1B7UTYukwBuR_uhJH
|
|
|
85
85
|
dbt_platform_helper/utils/git.py,sha256=7JGZMaI8-cU6-GjXIXjOlsYfKu_RppLOGyAicBd4n_8,704
|
|
86
86
|
dbt_platform_helper/utils/manifests.py,sha256=ji3UYHCxq9tTpkm4MlRa2y0-JOYYqq1pWZ2h_zpj0UU,507
|
|
87
87
|
dbt_platform_helper/utils/messages.py,sha256=nWA7BWLb7ND0WH5TejDN4OQUJSKYBxU4tyCzteCrfT0,142
|
|
88
|
-
dbt_platform_helper/utils/platform_config.py,sha256=hAQ7bX-Jqu4L9zPYpBq3EK73LRhOK5-fEP2r3MbT_iQ,475
|
|
89
88
|
dbt_platform_helper/utils/template.py,sha256=g-Db-0I6a6diOHkgK1nYA0IxJSO4TRrjqOvlyeOR32o,950
|
|
90
|
-
dbt_platform_helper/utils/validation.py,sha256=
|
|
91
|
-
dbt_platform_helper/utils/versioning.py,sha256=
|
|
92
|
-
platform_helper.py,sha256=
|
|
93
|
-
dbt_platform_helper-13.0.
|
|
94
|
-
dbt_platform_helper-13.0.
|
|
95
|
-
dbt_platform_helper-13.0.
|
|
96
|
-
dbt_platform_helper-13.0.
|
|
97
|
-
dbt_platform_helper-13.0.
|
|
89
|
+
dbt_platform_helper/utils/validation.py,sha256=coN7WsKW_nPGW9EU23AInBkAuvUl1NfQvc2bjVtgs14,1188
|
|
90
|
+
dbt_platform_helper/utils/versioning.py,sha256=QCvDUizLNNYbt3iLRqcWxgOP_PMfLIZARUZ5dW542fI,9056
|
|
91
|
+
platform_helper.py,sha256=lUGBsVgsGGJSDXxRvtvZCo2ybRAWuJXosbzfTzkIxU8,1892
|
|
92
|
+
dbt_platform_helper-13.1.0.dist-info/LICENSE,sha256=dP79lN73--7LMApnankTGLqDbImXg8iYFqWgnExGkGk,1090
|
|
93
|
+
dbt_platform_helper-13.1.0.dist-info/METADATA,sha256=9dgW1t_rW-kPfCLMFIvVTYzBza_8x829wo3Yw2-QUB0,3212
|
|
94
|
+
dbt_platform_helper-13.1.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
95
|
+
dbt_platform_helper-13.1.0.dist-info/entry_points.txt,sha256=QhbY8F434A-onsg0-FsdMd2U6HKh6Q7yCFFZrGUh5-M,67
|
|
96
|
+
dbt_platform_helper-13.1.0.dist-info/RECORD,,
|
platform_helper.py
CHANGED
|
@@ -15,7 +15,7 @@ from dbt_platform_helper.commands.generate import generate as generate_commands
|
|
|
15
15
|
from dbt_platform_helper.commands.notify import notify as notify_commands
|
|
16
16
|
from dbt_platform_helper.commands.pipeline import pipeline as pipeline_commands
|
|
17
17
|
from dbt_platform_helper.commands.secrets import secrets as secrets_commands
|
|
18
|
-
from dbt_platform_helper.commands.version import
|
|
18
|
+
from dbt_platform_helper.commands.version import version as version_commands
|
|
19
19
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
20
20
|
|
|
21
21
|
|
|
@@ -39,7 +39,7 @@ platform_helper.add_command(pipeline_commands)
|
|
|
39
39
|
platform_helper.add_command(secrets_commands)
|
|
40
40
|
platform_helper.add_command(notify_commands)
|
|
41
41
|
platform_helper.add_command(database_commands)
|
|
42
|
-
platform_helper.add_command(
|
|
42
|
+
platform_helper.add_command(version_commands)
|
|
43
43
|
|
|
44
44
|
if __name__ == "__main__":
|
|
45
45
|
platform_helper()
|