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.
- cdk_factory/pipeline/pipeline_factory.py +29 -16
- cdk_factory/version.py +1 -1
- {cdk_factory-0.15.17.dist-info → cdk_factory-0.15.19.dist-info}/METADATA +1 -1
- {cdk_factory-0.15.17.dist-info → cdk_factory-0.15.19.dist-info}/RECORD +7 -7
- {cdk_factory-0.15.17.dist-info → cdk_factory-0.15.19.dist-info}/WHEEL +0 -0
- {cdk_factory-0.15.17.dist-info → cdk_factory-0.15.19.dist-info}/entry_points.txt +0 -0
- {cdk_factory-0.15.17.dist-info → cdk_factory-0.15.19.dist-info}/licenses/LICENSE +0 -0
|
@@ -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
|
-
#
|
|
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
|
|
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
|
-
|
|
337
|
-
if isinstance(
|
|
338
|
-
|
|
339
|
-
if
|
|
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":
|
|
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
|
|
428
|
-
#
|
|
429
|
-
|
|
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.
|
|
1
|
+
__version__ = "0.15.19"
|
|
@@ -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=
|
|
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=
|
|
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.
|
|
133
|
-
cdk_factory-0.15.
|
|
134
|
-
cdk_factory-0.15.
|
|
135
|
-
cdk_factory-0.15.
|
|
136
|
-
cdk_factory-0.15.
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|