cdk-factory 0.9.3__py3-none-any.whl → 0.9.5__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.

@@ -248,11 +248,11 @@ class PipelineFactoryStack(cdk.Stack):
248
248
  def _get_steps(self, key: str, stage_config: PipelineStageConfig):
249
249
  """
250
250
  Gets the build steps from the config.json.
251
-
251
+
252
252
  Commands can be:
253
253
  - A list of strings (each string is a separate command)
254
254
  - A single multi-line string (treated as a single script block)
255
-
255
+
256
256
  This allows support for complex shell constructs like if blocks, loops, etc.
257
257
  """
258
258
  shell_steps: List[pipelines.ShellStep] = []
@@ -264,12 +264,12 @@ class PipelineFactoryStack(cdk.Stack):
264
264
  for step in steps:
265
265
  step_id = step.get("id") or step.get("name")
266
266
  commands = step.get("commands", [])
267
-
267
+
268
268
  # Normalize commands to a list
269
269
  # If commands is a single string, wrap it in a list
270
270
  if isinstance(commands, str):
271
271
  commands = [commands]
272
-
272
+
273
273
  shell_step = pipelines.ShellStep(
274
274
  id=step_id,
275
275
  commands=commands,
@@ -359,19 +359,47 @@ class PipelineFactoryStack(cdk.Stack):
359
359
 
360
360
  build_commands = self._get_build_commands()
361
361
 
362
- cdk_out_directory = self.workload.output_directory
362
+ # Calculate where cdk.out will be created relative to project root
363
+ # The build commands cd into cdk_directory and create ./cdk.out there
364
+ # We need to tell the pipeline where to find those artifacts
365
+ import os
366
+ from pathlib import Path
363
367
 
364
- # CdkAppFactory already provides the correct path:
365
- # - For pipelines: relative path (e.g., "../../cdk.out" or "cdk.out")
366
- # - For local: absolute path (but this code only runs for pipelines)
367
- # If somehow we get an absolute path, convert it to just the basename
368
- if cdk_out_directory and os.path.isabs(cdk_out_directory):
369
- # Fallback: just use the last component
370
- cdk_out_directory = os.path.basename(cdk_out_directory)
368
+ # Get the directory portion of cdk_app_file
369
+ cdk_dir_path = Path(cdk_directory)
370
+
371
+ # If we have CODEBUILD_SRC_DIR, use it as the base to calculate relative path
372
+ codebuild_src = os.getenv('CODEBUILD_SRC_DIR')
373
+
374
+ if codebuild_src and cdk_dir_path.is_absolute():
375
+ # Calculate relative path from CodeBuild source directory
376
+ # Example: /codebuild/.../src/devops/cdk-iac relative to /codebuild/.../src = devops/cdk-iac
377
+ try:
378
+ cdk_relative_dir = os.path.relpath(str(cdk_dir_path), codebuild_src)
379
+ # If relpath resulted in going up directories (starts with ..), use empty
380
+ # If relpath is '.' (same directory), use empty (app.py at root)
381
+ if cdk_relative_dir.startswith('..') or cdk_relative_dir == '.':
382
+ cdk_relative_dir = ""
383
+ except ValueError:
384
+ # Paths on different drives (Windows) - fallback to empty
385
+ cdk_relative_dir = ""
386
+ elif cdk_dir_path.is_absolute():
387
+ # No CODEBUILD_SRC_DIR but path is absolute - can't determine relative path reliably
388
+ # Fallback to empty (will use "cdk.out" at root)
389
+ cdk_relative_dir = ""
390
+ else:
391
+ # Path is already relative - use as-is
392
+ cdk_relative_dir = str(cdk_dir_path)
393
+
394
+ # Construct the path to cdk.out relative to project root
395
+ if cdk_relative_dir:
396
+ cdk_out_directory = f"{cdk_relative_dir}/cdk.out"
397
+ else:
398
+ cdk_out_directory = "cdk.out"
371
399
 
372
400
  build_commands.append(f"echo 👉 cdk_directory: {cdk_directory}")
373
- build_commands.append(f"echo 👉 cdk_out_directory (relative): {cdk_out_directory}")
374
- build_commands.append("echo 👉 PWD from synth shell step: ${PWD}")
401
+ build_commands.append(f"echo 👉 cdk_out_directory: {cdk_out_directory}")
402
+ build_commands.append("echo 👉 PWD from synth shell step: ${{PWD}}")
375
403
 
376
404
  shell = pipelines.ShellStep(
377
405
  "CDK Synth",
cdk_factory/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.9.3"
1
+ __version__ = "0.9.5"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdk_factory
3
- Version: 0.9.3
3
+ Version: 0.9.5
4
4
  Summary: CDK Factory. A QuickStarter and best practices setup for CDK projects
5
5
  Author-email: Eric Wilson <eric.wilson@geekcafe.com>
6
6
  License: MIT License
@@ -2,7 +2,7 @@ cdk_factory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  cdk_factory/app.py,sha256=TR9U84oc20x2oPH3tcSgr8ukxddqMQjVHILTgvBNsA4,8980
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=xKd3pzbczuMsdB08eLAOqZDUd_q1IRxwZ_ccAFL4c4A,22
5
+ cdk_factory/version.py,sha256=ORAtCCI2THBDcdzIbh6oBsoshDvkkmXUWpmO4Q5McAk,22
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
@@ -64,7 +64,7 @@ cdk_factory/interfaces/istack.py,sha256=bhTBs-o9FgKwvJMSuwxjUV6D3nUlvZHVzfm27jP9
64
64
  cdk_factory/interfaces/live_ssm_resolver.py,sha256=3FIr9a02SXqZmbFs3RT0WxczWEQR_CF7QSt7kWbDrVE,8163
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
- cdk_factory/pipeline/pipeline_factory.py,sha256=NSyuADuVPsmNeo7-uoRZJrnn_KVdHzwXjLKLUcsJwRA,16480
67
+ cdk_factory/pipeline/pipeline_factory.py,sha256=OYziT0n1CwjEecLgC8IIAmtbTEOyNfS5JEDmzcjkXuk,17743
68
68
  cdk_factory/pipeline/stage.py,sha256=Be7ExMB9A-linRM18IQDOzQ-cP_I2_ThRNzlT4FIrUg,437
69
69
  cdk_factory/pipeline/security/policies.py,sha256=H3-S6nipz3UtF9Pc5eJYr4-aREUTCaJWMjOUyd6Rdv4,4406
70
70
  cdk_factory/pipeline/security/roles.py,sha256=ZB_O5H_BXgotvVspS2kVad9EMcY-a_-vU7Nm1_Z5MB8,4985
@@ -119,8 +119,8 @@ cdk_factory/utilities/lambda_function_utilities.py,sha256=S1GvBsY_q2cyUiaud3HORJ
119
119
  cdk_factory/utilities/os_execute.py,sha256=5Op0LY_8Y-pUm04y1k8MTpNrmQvcLmQHPQITEP7EuSU,1019
120
120
  cdk_factory/utils/api_gateway_utilities.py,sha256=If7Xu5s_UxmuV-kL3JkXxPLBdSVUKoLtohm0IUFoiV8,4378
121
121
  cdk_factory/workload/workload_factory.py,sha256=yBUDGIuB8-5p_mGcVFxsD2ZoZIziak3yh3LL3JvS0M4,5903
122
- cdk_factory-0.9.3.dist-info/METADATA,sha256=J6-gWzSHahIyQU5gNMKs8UGYsKfD32XRDt0thjCL9sk,2450
123
- cdk_factory-0.9.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
124
- cdk_factory-0.9.3.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
125
- cdk_factory-0.9.3.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
126
- cdk_factory-0.9.3.dist-info/RECORD,,
122
+ cdk_factory-0.9.5.dist-info/METADATA,sha256=yjJp1FFXxz0rUS_B25Ow_K9di6vHGViv_A9YCPcLxkI,2450
123
+ cdk_factory-0.9.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
124
+ cdk_factory-0.9.5.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
125
+ cdk_factory-0.9.5.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
126
+ cdk_factory-0.9.5.dist-info/RECORD,,