Skip to content

Conversation

@yngvark
Copy link
Contributor

@yngvark yngvark commented Apr 11, 2025

Description

  • Adds option for storing images in SSM
  • Copy tags from existing task definition to new.

Motivation and Context

Support Terraform deployment that reads the current image from SSM: https://github.com/oslokommune/pirates-iac/blob/672791bfebb05b6d16c5e00436dace27e65b8d5e/stacks/dev/app-too-tikki/_gp_ssm_container_images.tf

@yngvark yngvark changed the title Store images in ssm feat: Store images in ssm Apr 11, 2025
@yngvark yngvark force-pushed the store_images_in_ssm branch from 4fd263f to 6c13740 Compare April 11, 2025 07:38
@yngvark yngvark changed the title feat: Store images in ssm feat: Store images in ssm. Copy tags. Apr 11, 2025
@yngvark yngvark requested a review from Copilot April 11, 2025 07:46
@yngvark yngvark marked this pull request as ready for review April 11, 2025 07:47
@yngvark yngvark requested a review from a team as a code owner April 11, 2025 07:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

ecs-update-and-deploy-task-definition/action.yml:181

  • Using jq without compact formatting might produce JSON output with unnecessary whitespace or newlines that could cause issues when stored as an SSM parameter. Consider using jq with the -c flag to generate compact JSON.
MERGED_IMAGES=$(echo "$CURRENT_IMAGES" | jq --argjson new "$DEPLOYED_IMAGES" '. + $new')

Comment on lines +176 to +178
--output text)
echo "Current images from SSM: (These are all images stored for this task definition, before deploying.)"
echo $CURRENT_IMAGES | jq
Copy link

Copilot AI Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command does not handle cases where the SSM parameter does not exist, which could cause the script to fail. Consider adding error handling or providing a default value for CURRENT_IMAGES if the parameter is missing.

Suggested change
--output text)
echo "Current images from SSM: (These are all images stored for this task definition, before deploying.)"
echo $CURRENT_IMAGES | jq
--output text 2>/dev/null || echo "[]")
if [ "$CURRENT_IMAGES" == "[]" ]; then
echo "SSM parameter '$SSM_PARAMETER_NAME' does not exist or is empty. Using default value: []"
else
echo "Current images from SSM: (These are all images stored for this task definition, before deploying.)"
echo $CURRENT_IMAGES | jq
fi

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant