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

@@ -5,6 +5,7 @@ Geek Cafe Pipeline
5
5
  import os
6
6
  from pathlib import Path
7
7
  from typing import List, Dict, Any
8
+ import yaml
8
9
 
9
10
  import aws_cdk as cdk
10
11
  from aws_cdk import aws_codebuild as codebuild
@@ -326,28 +327,42 @@ class PipelineFactoryStack(IStack):
326
327
  return None
327
328
 
328
329
  # Parse buildspec
329
- # For CodeBuildStep with external source, buildspec.yml is read automatically from the repo
330
- # We only need to create a custom buildspec if using inline commands
330
+ # If a buildspec path is specified, try to load it locally and convert to from_object()
331
331
  buildspec_path = build.get("buildspec")
332
332
  buildspec = None
333
-
334
- if not buildspec_path:
333
+
334
+ if buildspec_path:
335
+ try:
336
+ candidate = Path(buildspec_path)
337
+ if not candidate.is_file():
338
+ # Try relative to cwd
339
+ candidate = Path(os.getcwd()) / buildspec_path
340
+ if candidate.is_file():
341
+ with candidate.open("r", encoding="utf-8") as f:
342
+ yml = yaml.safe_load(f)
343
+ if isinstance(yml, dict):
344
+ buildspec = codebuild.BuildSpec.from_object(yml)
345
+ else:
346
+ raise ValueError("Parsed buildspec YAML is not a dictionary")
347
+ else:
348
+ raise FileNotFoundError(f"Buildspec file not found: {buildspec_path}")
349
+ except Exception as exc:
350
+ raise RuntimeError(f"Failed to load buildspec from '{buildspec_path}': {exc}")
351
+ else:
335
352
  # No buildspec specified - check for inline commands
336
- commands = build.get("commands", [])
337
- if isinstance(commands, str):
338
- commands = [commands]
339
- if commands:
353
+ inline_commands = build.get("commands", [])
354
+ if isinstance(inline_commands, str):
355
+ inline_commands = [inline_commands]
356
+ if inline_commands:
340
357
  # Create inline buildspec from commands
341
358
  buildspec = codebuild.BuildSpec.from_object({
342
359
  "version": "0.2",
343
360
  "phases": {
344
361
  "build": {
345
- "commands": commands
362
+ "commands": inline_commands
346
363
  }
347
364
  }
348
365
  })
349
- # If buildspec_path is specified, CodeBuildStep will automatically read it from the source repo
350
- # No need to load it explicitly
351
366
 
352
367
  # Parse environment configuration
353
368
  env_config = build.get("environment", {})
@@ -424,11 +439,9 @@ class PipelineFactoryStack(IStack):
424
439
  # Create CodeBuildStep
425
440
  logger.info(f"Creating CodeBuildStep '{build_name}' with source from {source_location}")
426
441
 
427
- # CodeBuildStep requires commands even when using partial_build_spec
428
- # Provide placeholder since either:
429
- # 1. buildspec.yml in the repo handles the build, or
430
- # 2. inline buildspec (partial_build_spec) handles the build
431
- commands = ["echo 'Build configuration from buildspec'"]
442
+ # CodeBuildStep requires 'commands' param; when using a buildspec (repo or inline)
443
+ # we pass an empty list so only the buildspec runs
444
+ commands: List[str] = []
432
445
 
433
446
  codebuild_step = pipelines.CodeBuildStep(
434
447
  id=f"{build_name}-{stage_name}",
cdk_factory/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.15.17"
1
+ __version__ = "0.15.19"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdk_factory
3
- Version: 0.15.17
3
+ Version: 0.15.19
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=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=OABxuEkZuI7drkI9YYXz7UOmkRsHy4oeaeeeKu5V4q8,24
5
+ cdk_factory/version.py,sha256=Z3uMBj60vZ3EVuxU5wkKqelcN0y_zs1XVBGw7z_-3cw,24
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
@@ -68,7 +68,7 @@ cdk_factory/interfaces/ssm_parameter_mixin.py,sha256=uA2j8HmAOpuEA9ynRj51s0WjUHM
68
68
  cdk_factory/lambdas/health_handler.py,sha256=dd40ykKMxWCFEIyp2ZdQvAGNjw_ylI9CSm1N24Hp2ME,196
69
69
  cdk_factory/lambdas/edge/ip_gate/handler.py,sha256=YrXO42gEhJoBTaH6jS7EWqjHe9t5Fpt4WLgY8vjtou0,10474
70
70
  cdk_factory/pipeline/path_utils.py,sha256=fvWdrcb4onmpIu1APkHLhXg8zWfK74HcW3Ra2ynxfXM,2586
71
- cdk_factory/pipeline/pipeline_factory.py,sha256=xguwRk7VFJRrJIse6YtsujUz_J6MQ3xF4FWmQE4lpd0,25792
71
+ cdk_factory/pipeline/pipeline_factory.py,sha256=tZTFT-sniqWZk8I2sOTV2wP3fFQGiI_0rrtCi5oGtYg,26342
72
72
  cdk_factory/pipeline/stage.py,sha256=Be7ExMB9A-linRM18IQDOzQ-cP_I2_ThRNzlT4FIrUg,437
73
73
  cdk_factory/pipeline/security/policies.py,sha256=H3-S6nipz3UtF9Pc5eJYr4-aREUTCaJWMjOUyd6Rdv4,4406
74
74
  cdk_factory/pipeline/security/roles.py,sha256=ZB_O5H_BXgotvVspS2kVad9EMcY-a_-vU7Nm1_Z5MB8,4985
@@ -129,8 +129,8 @@ cdk_factory/utilities/lambda_function_utilities.py,sha256=S1GvBsY_q2cyUiaud3HORJ
129
129
  cdk_factory/utilities/os_execute.py,sha256=5Op0LY_8Y-pUm04y1k8MTpNrmQvcLmQHPQITEP7EuSU,1019
130
130
  cdk_factory/utils/api_gateway_utilities.py,sha256=If7Xu5s_UxmuV-kL3JkXxPLBdSVUKoLtohm0IUFoiV8,4378
131
131
  cdk_factory/workload/workload_factory.py,sha256=yDI3cRhVI5ELNDcJPLpk9UY54Uind1xQoV3spzT4z7E,6068
132
- cdk_factory-0.15.17.dist-info/METADATA,sha256=90MiXaFbf7StO0gjwQ3YKZa-rx0Ce8WkqtwmgcYpfmo,2452
133
- cdk_factory-0.15.17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
134
- cdk_factory-0.15.17.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
135
- cdk_factory-0.15.17.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
136
- cdk_factory-0.15.17.dist-info/RECORD,,
132
+ cdk_factory-0.15.19.dist-info/METADATA,sha256=ODF22xVdpQsHyeJOF05R1r0sI66hkIWjADBT5x58eRY,2452
133
+ cdk_factory-0.15.19.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
134
+ cdk_factory-0.15.19.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
135
+ cdk_factory-0.15.19.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
136
+ cdk_factory-0.15.19.dist-info/RECORD,,