cdk-factory 0.9.11__py3-none-any.whl → 0.9.12__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 cdk-factory might be problematic. Click here for more details.
- cdk_factory/app.py +39 -8
- cdk_factory/pipeline/pipeline_factory.py +1 -0
- cdk_factory/version.py +1 -1
- {cdk_factory-0.9.11.dist-info → cdk_factory-0.9.12.dist-info}/METADATA +1 -1
- {cdk_factory-0.9.11.dist-info → cdk_factory-0.9.12.dist-info}/RECORD +8 -8
- {cdk_factory-0.9.11.dist-info → cdk_factory-0.9.12.dist-info}/WHEEL +0 -0
- {cdk_factory-0.9.11.dist-info → cdk_factory-0.9.12.dist-info}/entry_points.txt +0 -0
- {cdk_factory-0.9.11.dist-info → cdk_factory-0.9.12.dist-info}/licenses/LICENSE +0 -0
cdk_factory/app.py
CHANGED
|
@@ -32,15 +32,12 @@ class CdkAppFactory:
|
|
|
32
32
|
config_path: str | None = None,
|
|
33
33
|
outdir: str | None = None,
|
|
34
34
|
add_env_context: bool = True,
|
|
35
|
-
auto_detect_project_root: bool = True,
|
|
36
|
-
is_pipeline: bool = False,
|
|
37
35
|
) -> None:
|
|
38
36
|
|
|
39
37
|
self.args = args or CommandlineArgs()
|
|
40
38
|
self.runtime_directory = runtime_directory
|
|
41
39
|
self.config_path: str | None = config_path
|
|
42
40
|
self.add_env_context = add_env_context
|
|
43
|
-
self._is_pipeline = is_pipeline
|
|
44
41
|
|
|
45
42
|
# Auto-detect runtime_directory if not provided
|
|
46
43
|
if not self.runtime_directory:
|
|
@@ -50,21 +47,26 @@ class CdkAppFactory:
|
|
|
50
47
|
# 1. Explicit outdir parameter (highest priority)
|
|
51
48
|
# 2. CDK_OUTDIR environment variable
|
|
52
49
|
# 3. Default: {runtime_directory}/cdk.out
|
|
53
|
-
|
|
50
|
+
|
|
54
51
|
supplied_outdir = outdir or (
|
|
55
52
|
self.args.outdir if hasattr(self.args, "outdir") else None
|
|
56
53
|
)
|
|
57
|
-
|
|
54
|
+
|
|
58
55
|
if supplied_outdir:
|
|
59
|
-
# Explicit outdir:
|
|
60
|
-
|
|
56
|
+
# Explicit outdir: if relative, resolve against runtime_directory
|
|
57
|
+
# If absolute, use as-is
|
|
58
|
+
if os.path.isabs(supplied_outdir):
|
|
59
|
+
self.outdir = supplied_outdir
|
|
60
|
+
else:
|
|
61
|
+
# Relative path: resolve against runtime_directory, not cwd
|
|
62
|
+
self.outdir = os.path.join(self.runtime_directory, supplied_outdir)
|
|
61
63
|
elif os.getenv("CDK_OUTDIR"):
|
|
62
64
|
# Environment variable override
|
|
63
65
|
self.outdir = os.path.abspath(os.getenv("CDK_OUTDIR"))
|
|
64
66
|
else:
|
|
65
67
|
# Default: cdk.out in runtime_directory
|
|
66
68
|
# This resolves correctly in both local and CodeBuild environments
|
|
67
|
-
self.outdir =
|
|
69
|
+
self.outdir = os.path.join(self.runtime_directory, "cdk.out")
|
|
68
70
|
|
|
69
71
|
# Clean and recreate directory for fresh synthesis
|
|
70
72
|
if os.path.exists(self.outdir):
|
|
@@ -126,6 +128,8 @@ class CdkAppFactory:
|
|
|
126
128
|
# Validate that the assembly directory exists and has files
|
|
127
129
|
self._validate_synth_output(assembly)
|
|
128
130
|
|
|
131
|
+
self._copy_cdk_out_to_project_root()
|
|
132
|
+
|
|
129
133
|
return assembly
|
|
130
134
|
|
|
131
135
|
def _validate_synth_output(self, assembly: CloudAssembly) -> None:
|
|
@@ -244,6 +248,33 @@ class CdkAppFactory:
|
|
|
244
248
|
# Priority 4: Fallback to runtime_directory
|
|
245
249
|
return str(current)
|
|
246
250
|
|
|
251
|
+
def _copy_cdk_out_to_project_root(self):
|
|
252
|
+
# Copy the cdk.out directory to the project root so it can be picked up by CodeBuild
|
|
253
|
+
# Source: the actual CDK output directory from the synthesis (e.g., /tmp/cdk-factory/cdk.out)
|
|
254
|
+
cdk_out_source = self.outdir
|
|
255
|
+
|
|
256
|
+
# raise Exception(f"cdk_out_source: {cdk_out_source}")
|
|
257
|
+
|
|
258
|
+
# Destination: project root (two directories up from devops/cdk-iac where this file lives)
|
|
259
|
+
project_root = os.getenv("CODEBUILD_SRC_DIR")
|
|
260
|
+
if not project_root:
|
|
261
|
+
return
|
|
262
|
+
|
|
263
|
+
cdk_out_dest = os.path.join(project_root, "cdk.out")
|
|
264
|
+
|
|
265
|
+
print(f"👉 Project root: {project_root}")
|
|
266
|
+
print(f"👉 CDK output source: {cdk_out_source}")
|
|
267
|
+
print(f"👉 CDK output destination: {cdk_out_dest}")
|
|
268
|
+
|
|
269
|
+
if os.path.exists(cdk_out_dest):
|
|
270
|
+
print("❌ CDK output directory already exists, skipping copy")
|
|
271
|
+
return
|
|
272
|
+
else:
|
|
273
|
+
print("✅ CDK output directory does not exist, copying")
|
|
274
|
+
|
|
275
|
+
shutil.copytree(cdk_out_source, cdk_out_dest)
|
|
276
|
+
print(f"✅ Copied CDK output to {cdk_out_dest}")
|
|
277
|
+
|
|
247
278
|
|
|
248
279
|
if __name__ == "__main__":
|
|
249
280
|
# deploy_test()
|
|
@@ -403,6 +403,7 @@ class PipelineFactoryStack(IStack):
|
|
|
403
403
|
relative_path = os.path.relpath(abs_output, abs_cwd)
|
|
404
404
|
return relative_path
|
|
405
405
|
except ValueError:
|
|
406
|
+
print(f"Failed to compute relative path from {abs_output} to {abs_cwd}")
|
|
406
407
|
# Different drives on Windows or other edge case
|
|
407
408
|
# Fall back to basename approach (just the directory name)
|
|
408
409
|
return "cdk.out"
|
cdk_factory/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.9.
|
|
1
|
+
__version__ = "0.9.12"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
cdk_factory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
cdk_factory/app.py,sha256=
|
|
2
|
+
cdk_factory/app.py,sha256=RnX0-pwdTAPAdKJK_j13Zl8anf9zYKBwboR0KA8K8xM,10346
|
|
3
3
|
cdk_factory/cdk.json,sha256=SKZKhJ2PBpFH78j-F8S3VDYW-lf76--Q2I3ON-ZIQfw,3106
|
|
4
4
|
cdk_factory/cli.py,sha256=FGbCTS5dYCNsfp-etshzvFlGDCjC28r6rtzYbe7KoHI,6407
|
|
5
|
-
cdk_factory/version.py,sha256=
|
|
5
|
+
cdk_factory/version.py,sha256=XR5b9xrEQYlPbzUgeAtHjn10uKetzrpCdRIvgcGJkoI,23
|
|
6
6
|
cdk_factory/builds/README.md,sha256=9BBWd7bXpyKdMU_g2UljhQwrC9i5O_Tvkb6oPvndoZk,90
|
|
7
7
|
cdk_factory/commands/command_loader.py,sha256=QbLquuP_AdxtlxlDy-2IWCQ6D-7qa58aphnDPtp_uTs,3744
|
|
8
8
|
cdk_factory/configurations/base_config.py,sha256=JKjhNsy0RCUZy1s8n5D_aXXI-upR9izaLtCTfKYiV9k,9624
|
|
@@ -65,7 +65,7 @@ cdk_factory/interfaces/live_ssm_resolver.py,sha256=3FIr9a02SXqZmbFs3RT0WxczWEQR_
|
|
|
65
65
|
cdk_factory/interfaces/ssm_parameter_mixin.py,sha256=uA2j8HmAOpuEA9ynRj51s0WjUHMVLsbLQN-QS9NKyHA,12089
|
|
66
66
|
cdk_factory/lambdas/health_handler.py,sha256=dd40ykKMxWCFEIyp2ZdQvAGNjw_ylI9CSm1N24Hp2ME,196
|
|
67
67
|
cdk_factory/pipeline/path_utils.py,sha256=fvWdrcb4onmpIu1APkHLhXg8zWfK74HcW3Ra2ynxfXM,2586
|
|
68
|
-
cdk_factory/pipeline/pipeline_factory.py,sha256=
|
|
68
|
+
cdk_factory/pipeline/pipeline_factory.py,sha256=rvtkdlTPJG477nTVRN8S2ksWt4bwpd9eVLFd9WO02pM,17248
|
|
69
69
|
cdk_factory/pipeline/stage.py,sha256=Be7ExMB9A-linRM18IQDOzQ-cP_I2_ThRNzlT4FIrUg,437
|
|
70
70
|
cdk_factory/pipeline/security/policies.py,sha256=H3-S6nipz3UtF9Pc5eJYr4-aREUTCaJWMjOUyd6Rdv4,4406
|
|
71
71
|
cdk_factory/pipeline/security/roles.py,sha256=ZB_O5H_BXgotvVspS2kVad9EMcY-a_-vU7Nm1_Z5MB8,4985
|
|
@@ -120,8 +120,8 @@ cdk_factory/utilities/lambda_function_utilities.py,sha256=S1GvBsY_q2cyUiaud3HORJ
|
|
|
120
120
|
cdk_factory/utilities/os_execute.py,sha256=5Op0LY_8Y-pUm04y1k8MTpNrmQvcLmQHPQITEP7EuSU,1019
|
|
121
121
|
cdk_factory/utils/api_gateway_utilities.py,sha256=If7Xu5s_UxmuV-kL3JkXxPLBdSVUKoLtohm0IUFoiV8,4378
|
|
122
122
|
cdk_factory/workload/workload_factory.py,sha256=yBUDGIuB8-5p_mGcVFxsD2ZoZIziak3yh3LL3JvS0M4,5903
|
|
123
|
-
cdk_factory-0.9.
|
|
124
|
-
cdk_factory-0.9.
|
|
125
|
-
cdk_factory-0.9.
|
|
126
|
-
cdk_factory-0.9.
|
|
127
|
-
cdk_factory-0.9.
|
|
123
|
+
cdk_factory-0.9.12.dist-info/METADATA,sha256=wgeRcZWqPKX7AJQGcU38dz44uB09hpGdp-MVTjfxsOA,2451
|
|
124
|
+
cdk_factory-0.9.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
125
|
+
cdk_factory-0.9.12.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
|
|
126
|
+
cdk_factory-0.9.12.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
|
|
127
|
+
cdk_factory-0.9.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|