Skip to content

Commit

Permalink
switching to json due to lack of multiline support in codepipeline va…
Browse files Browse the repository at this point in the history
…riables
  • Loading branch information
eamonnfaherty committed Oct 15, 2024
1 parent d1bc751 commit 8f99909
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions servicecatalog_puppet/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def expand(f, single_account_or_action_configuration):
puppet_account_id = remote_config.get_puppet_account_id()
regions = remote_config.get_regions(puppet_account_id, constants.HOME_REGION)
print(f"single_account_or_action_configuration is {single_account_or_action_configuration}")
overrides = yaml.safe_load(single_account_or_action_configuration)
overrides = json.loads(single_account_or_action_configuration)
print(f"overrides is {overrides}")

if overrides.get("subset"):
Expand Down Expand Up @@ -632,7 +632,7 @@ def deploy_from_task_reference(
):
params = dict()

overrides = dict(**yaml.safe_load(single_account_or_action_configuration))
overrides = dict(json.loads(single_account_or_action_configuration))
if overrides.get("subset"):
subset = overrides.get("subset")
overrides = dict(
Expand Down
10 changes: 2 additions & 8 deletions servicecatalog_puppet/template_builder/hub/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ def generate_single_account_run_projects(
install=install_spec,
build={
"commands": [
'aws codepipeline start-pipeline-execution --name servicecatalog-puppet-pipeline --variables name=single_account_or_action_configuration,value="single_account: \\"${SINGLE_ACCOUNT_ID}\\""'
"aws codepipeline start-pipeline-execution --name servicecatalog-puppet-pipeline --variables name=single_account_or_action_configuration,value='{\"single_account\": \"${SINGLE_ACCOUNT_ID}\"}'"
]
},
post_build={
Expand Down Expand Up @@ -1405,13 +1405,7 @@ def generate_single_action_run_projects(
install=install_spec,
build={
"commands": [
'echo "section: \\"${SECTION}\\"" > parameters.yaml',
'echo "item: \\"${ITEM}\\"" >> parameters.yaml',
'echo "include_dependencies: ${INCLUDE_DEPENDENCIES}" >> parameters.yaml',
'echo "include_reverse_dependencies: ${INCLUDE_REVERSE_DEPENDENCIES}" >> parameters.yaml',
"cat parameters.yaml",
"zip parameters.zip parameters.yaml",
"aws s3 cp parameters.zip s3://sc-puppet-parameterised-runs-${PUPPET_ACCOUNT_ID}/parameters.zip",
'aws codepipeline start-pipeline-execution --name servicecatalog-puppet-pipeline --variables name=single_account_or_action_configuration,value="section: ${SECTION}\\nitem: ${item}\\ninclude_dependencies: ${INCLUDE_DEPENDENCIES}\\ninclude_reverse_dependencies: ${INCLUDE_REVERSE_DEPENDENCIES}"'
]
},
post_build={
Expand Down

0 comments on commit 8f99909

Please sign in to comment.