cdk-factory 0.9.10__py3-none-any.whl → 0.9.11__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 +19 -33
- cdk_factory/pipeline/pipeline_factory.py +36 -6
- cdk_factory/version.py +1 -1
- {cdk_factory-0.9.10.dist-info → cdk_factory-0.9.11.dist-info}/METADATA +1 -1
- {cdk_factory-0.9.10.dist-info → cdk_factory-0.9.11.dist-info}/RECORD +8 -8
- {cdk_factory-0.9.10.dist-info → cdk_factory-0.9.11.dist-info}/WHEEL +0 -0
- {cdk_factory-0.9.10.dist-info → cdk_factory-0.9.11.dist-info}/entry_points.txt +0 -0
- {cdk_factory-0.9.10.dist-info → cdk_factory-0.9.11.dist-info}/licenses/LICENSE +0 -0
cdk_factory/app.py
CHANGED
|
@@ -42,37 +42,29 @@ class CdkAppFactory:
|
|
|
42
42
|
self.add_env_context = add_env_context
|
|
43
43
|
self._is_pipeline = is_pipeline
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
# Auto-detect runtime_directory if not provided
|
|
46
|
+
if not self.runtime_directory:
|
|
46
47
|
self.runtime_directory = FileOperations.caller_app_dir()
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
#
|
|
49
|
+
# Determine output directory with clear priority order:
|
|
50
|
+
# 1. Explicit outdir parameter (highest priority)
|
|
51
|
+
# 2. CDK_OUTDIR environment variable
|
|
52
|
+
# 3. Default: {runtime_directory}/cdk.out
|
|
53
|
+
|
|
51
54
|
supplied_outdir = outdir or (
|
|
52
55
|
self.args.outdir if hasattr(self.args, "outdir") else None
|
|
53
56
|
)
|
|
54
|
-
|
|
57
|
+
|
|
55
58
|
if supplied_outdir:
|
|
56
|
-
#
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
namespace = supplied_outdir.rstrip("/")
|
|
62
|
-
if not namespace or namespace in (".", ".."):
|
|
63
|
-
namespace = "default"
|
|
64
|
-
# TODO: NOT SURE IF WE SHOULD DO THIS
|
|
65
|
-
self.outdir = f"/tmp/cdk-factory/{namespace}/cdk.out"
|
|
59
|
+
# Explicit outdir: convert to absolute path
|
|
60
|
+
self.outdir = os.path.abspath(supplied_outdir)
|
|
61
|
+
elif os.getenv("CDK_OUTDIR"):
|
|
62
|
+
# Environment variable override
|
|
63
|
+
self.outdir = os.path.abspath(os.getenv("CDK_OUTDIR"))
|
|
66
64
|
else:
|
|
67
|
-
# Default: cdk.out
|
|
68
|
-
# This
|
|
69
|
-
self.outdir = str(Path(self.runtime_directory) / "cdk.out")
|
|
70
|
-
|
|
71
|
-
# Env or CLI still win if you want to honor them:
|
|
72
|
-
env_out = os.getenv("CDK_OUTDIR")
|
|
73
|
-
if env_out:
|
|
74
|
-
self.outdir = os.path.abspath(env_out)
|
|
75
|
-
print(f"[cdk-factory] CDK_OUTDIR override -> {self.outdir}")
|
|
65
|
+
# Default: cdk.out in runtime_directory
|
|
66
|
+
# This resolves correctly in both local and CodeBuild environments
|
|
67
|
+
self.outdir = str(Path(self.runtime_directory).resolve() / "cdk.out")
|
|
76
68
|
|
|
77
69
|
# Clean and recreate directory for fresh synthesis
|
|
78
70
|
if os.path.exists(self.outdir):
|
|
@@ -81,8 +73,6 @@ class CdkAppFactory:
|
|
|
81
73
|
|
|
82
74
|
self.app: aws_cdk.App = aws_cdk.App(outdir=self.outdir)
|
|
83
75
|
|
|
84
|
-
print(f"📂 CDK output directory: {self.outdir}")
|
|
85
|
-
|
|
86
76
|
def synth(
|
|
87
77
|
self,
|
|
88
78
|
cdk_app_file: str | None = None,
|
|
@@ -95,13 +85,9 @@ class CdkAppFactory:
|
|
|
95
85
|
CloudAssembly: CDK CloudAssembly
|
|
96
86
|
"""
|
|
97
87
|
|
|
98
|
-
print(f"👋 Synthesizing CDK App from
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
print(f"📂 CDK output directory: {self.outdir}")
|
|
102
|
-
print(
|
|
103
|
-
f" └─ Consistent location works in both local and CodeBuild environments"
|
|
104
|
-
)
|
|
88
|
+
print(f"👋 Synthesizing CDK App from cdk-factory v{__version__}")
|
|
89
|
+
print(f"📂 Runtime directory: {self.runtime_directory}")
|
|
90
|
+
print(f"📂 Output directory: {self.outdir}")
|
|
105
91
|
|
|
106
92
|
if not paths:
|
|
107
93
|
paths = []
|
|
@@ -359,14 +359,17 @@ class PipelineFactoryStack(IStack):
|
|
|
359
359
|
|
|
360
360
|
build_commands = self._get_build_commands()
|
|
361
361
|
|
|
362
|
-
#
|
|
363
|
-
# This
|
|
364
|
-
|
|
365
|
-
|
|
362
|
+
# Convert absolute output directory to relative path for BuildSpec
|
|
363
|
+
# This prevents baking in local absolute paths
|
|
364
|
+
cdk_out_directory = self._get_relative_output_directory()
|
|
365
|
+
|
|
366
|
+
if cdk_out_directory.startswith("/"):
|
|
367
|
+
raise ValueError("CDK output directory must be a relative path")
|
|
366
368
|
|
|
367
369
|
# Debug logging - will be baked into buildspec
|
|
368
|
-
build_commands.append(
|
|
369
|
-
|
|
370
|
+
build_commands.append(
|
|
371
|
+
f"echo '👉 CDK output directory (relative): {cdk_out_directory}'"
|
|
372
|
+
)
|
|
370
373
|
|
|
371
374
|
shell = pipelines.ShellStep(
|
|
372
375
|
"CDK Synth",
|
|
@@ -377,6 +380,33 @@ class PipelineFactoryStack(IStack):
|
|
|
377
380
|
|
|
378
381
|
return shell
|
|
379
382
|
|
|
383
|
+
def _get_relative_output_directory(self) -> str:
|
|
384
|
+
"""
|
|
385
|
+
Convert absolute output directory to relative path from repository root.
|
|
386
|
+
This prevents baking local absolute paths into the BuildSpec.
|
|
387
|
+
|
|
388
|
+
Example:
|
|
389
|
+
Absolute: /Users/eric/project/devops/cdk-iac/cdk.out
|
|
390
|
+
Relative: devops/cdk-iac/cdk.out
|
|
391
|
+
"""
|
|
392
|
+
output_dir = self.workload.output_directory
|
|
393
|
+
|
|
394
|
+
# Get the current working directory (repository root during synthesis)
|
|
395
|
+
cwd = os.getcwd()
|
|
396
|
+
|
|
397
|
+
# Convert to absolute paths for reliable comparison
|
|
398
|
+
abs_output = os.path.abspath(output_dir)
|
|
399
|
+
abs_cwd = os.path.abspath(cwd)
|
|
400
|
+
|
|
401
|
+
# Compute relative path from repo root to output directory
|
|
402
|
+
try:
|
|
403
|
+
relative_path = os.path.relpath(abs_output, abs_cwd)
|
|
404
|
+
return relative_path
|
|
405
|
+
except ValueError:
|
|
406
|
+
# Different drives on Windows or other edge case
|
|
407
|
+
# Fall back to basename approach (just the directory name)
|
|
408
|
+
return "cdk.out"
|
|
409
|
+
|
|
380
410
|
def _get_build_commands(self) -> List[str]:
|
|
381
411
|
# print("generating building commands")
|
|
382
412
|
|
cdk_factory/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.9.
|
|
1
|
+
__version__ = "0.9.11"
|
|
@@ -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=Hszv0nQAaCOULvOKWitxLyKnU9keUnb9MOKGPe0RaFo,9060
|
|
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=hCWvJmnndbpxCyOQ7z-g5qleaxwixXNqkmkxuORqf1I,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=miIJZFV7BLmL1r0Pv8ZNH8hu2j0SdXVcuScajIBCZYk,17163
|
|
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.11.dist-info/METADATA,sha256=IGWNlOy29lMWoiIqxscoErO82WTWoCcYoabgefQMgw0,2451
|
|
124
|
+
cdk_factory-0.9.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
125
|
+
cdk_factory-0.9.11.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
|
|
126
|
+
cdk_factory-0.9.11.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
|
|
127
|
+
cdk_factory-0.9.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|