Skip to content

VED-1116: Update PR Teardown to delete PR recordprocessor images#1302

Closed
Thomas-Boyle wants to merge 60 commits intomasterfrom
1116-pr-teardown-images
Closed

VED-1116: Update PR Teardown to delete PR recordprocessor images#1302
Thomas-Boyle wants to merge 60 commits intomasterfrom
1116-pr-teardown-images

Conversation

@Thomas-Boyle
Copy link
Copy Markdown
Contributor

  • Update PR Teardown workflow to delete all PR scoped recordprocessor images.

Thomas-Boyle and others added 30 commits March 10, 2026 10:58
…deployment dependencies

- Added a new GitHub Actions workflow for deploying the Recordprocessor batch processor.
- Updated the continuous deployment workflow to include a dependency on the new Recordprocessor deployment.
- Introduced a new variable for the Recordprocessor image tag in Terraform configuration.
- Refactored ECS task definition to use the new image tag variable for the Recordprocessor container.
- Explicitly set the AWS_INFRA_ROLE_ARN secret in the continuous deployment workflow.
- Upgrade aws-actions/configure-aws-credentials and aws-actions/amazon-ecr-login to specific versions for improved stability.
- Removed the separate Recordprocessor deployment workflow and integrated its functionality into the backend deployment workflow.
- Added a new input parameter `enable_recordprocessor` to conditionally build and push the Recordprocessor Docker image.
- Updated dependencies in the backend deployment to ensure proper execution order and image tagging for the Recordprocessor.
- Enhanced the continuous deployment workflow by simplifying dependencies and improving clarity.
… repository

- Changed the behavior of the ECR repository check to fail the build-and-push-recordprocessor job if the repository does not exist, instead of skipping the image build and push. This ensures that the deployment process is more robust and provides clearer feedback on repository availability.
- Modified the backend deployment workflow to include a new step for resolving the image tag based on the `enable_recordprocessor` input. This change ensures that the image tag is set to the output of the build-and-push step if the Recordprocessor is enabled, otherwise defaults to "latest". This enhances the clarity and reliability of the image tagging process during deployment.
- Adjusted the Dockerfile to use correct paths for Poetry files and source code within the `lambdas/recordprocessor` directory.
- Updated the deployment workflow to specify the Dockerfile location during the build process, ensuring proper image creation for the Recordprocessor.
- Updated paths in the Dockerfile to correctly reference the `recordprocessor` directory for Poetry files and source code.
- Adjusted the deployment workflow to ensure the Docker build command points to the correct location of the Dockerfile, enhancing the image build process.
- Changed the working directory for the Docker build command to the root of the repository, ensuring that all necessary files are included during the image build process.
- Adjusted the command to create the ECR repository to ensure it is correctly formatted, enhancing the reliability of the deployment workflow.
- Removed the `enable_recordprocessor` input from the continuous deployment workflow.
- Added a conditional check in the backend deployment workflow to skip the Docker build and push if the image already exists in ECR, improving efficiency and reducing unnecessary builds.
- Introduced a new `terraform-plan` job in the deployment workflow to manage infrastructure changes before applying them.
- Added steps for AWS connection, Terraform initialization, and planning, ensuring a structured approach to infrastructure management.
- Updated the `build-and-push-recordprocessor` job to depend on the `terraform-apply` job, streamlining the deployment process.
- Removed redundant image tag output handling, simplifying the workflow logic.
- Introduced a new step to import the ECR repository into Terraform state if it exists, enhancing the deployment process.
- This addition ensures that the workflow can manage existing resources more effectively, preventing potential conflicts during deployment.
- Eliminated the step that imported the ECR repository into Terraform state, streamlining the deployment process.
- This change simplifies the workflow by removing unnecessary checks for existing resources, focusing on a more straightforward deployment approach.
- Updated the deployment workflow to use a new naming convention for the Docker image tag and repository.
- Removed the conditional check for existing images in ECR, ensuring a build and push occurs every time.
- Introduced a new ECR repository resource for the record processor, enhancing image management.
- Adjusted IAM policies and ECS task definitions to reference the new repository configuration.
Co-authored-by: Ed Hall <239591530+edhall-nhs@users.noreply.github.com>
Co-authored-by: Ed Hall <239591530+edhall-nhs@users.noreply.github.com>
…anning

- Moved the `terraform-plan` job to depend on the `build-and-push-recordprocessor` job, ensuring a more logical sequence in the deployment process.
- Retained the steps for AWS connection, Terraform initialization, and planning within the `terraform-plan` job, maintaining infrastructure management integrity.
- Removed the previous `terraform-plan` job definition to streamline the workflow.
…t workflows

- Introduced a new input parameter `build_recordprocessor_image` in the deployment workflows to control the building of the recordprocessor Docker image.
- Updated the `deploy-backend.yml` to include logic for building the image based on changes detected in the PR.
- Added a new job in `pr-deploy-and-test.yml` to detect changes in the recordprocessor directory, influencing the deployment process.
- Enhanced the handling of image tags to default to 'latest' if no build is triggered, improving deployment flexibility.
- Added a new job to detect changes in the recordprocessor directory, influencing the build process for the Docker image.
- Updated the deployment workflows to conditionally build the recordprocessor image based on detected changes.
- Improved tagging of Docker images to include a 'latest' tag alongside the versioned tag for better image management.
- Adjusted dependencies in the deployment jobs to ensure proper sequencing and execution based on change detection.
- Modified the logic for setting the `TF_VAR_recordprocessor_image_tag` environment variable to include the `sub_environment` in the image tag format.
- This change improves the clarity and traceability of Docker image versions during deployment.
- Added output for `recordprocessor_image_tag` in `deploy-backend.yml` to streamline image tagging.
- Updated logic in `pr-deploy-and-test.yml` to conditionally build the recordprocessor image based on detected changes, improving deployment efficiency.
- Refined steps for resolving existing image tags, ensuring proper handling when no new image is built.
@sonarqubecloud
Copy link
Copy Markdown

@Thomas-Boyle Thomas-Boyle had a problem deploying to internal-dev-sandbox March 16, 2026 15:18 — with GitHub Actions Failure
@Thomas-Boyle Thomas-Boyle temporarily deployed to internal-dev-sandbox March 16, 2026 15:20 — with GitHub Actions Inactive
@Thomas-Boyle Thomas-Boyle temporarily deployed to internal-dev-sandbox March 16, 2026 15:20 — with GitHub Actions Inactive
@Thomas-Boyle Thomas-Boyle temporarily deployed to internal-dev-sandbox March 16, 2026 15:21 — with GitHub Actions Inactive
@Thomas-Boyle Thomas-Boyle deleted the 1116-pr-teardown-images branch March 16, 2026 15:31
@Thomas-Boyle Thomas-Boyle had a problem deploying to internal-dev-sandbox March 16, 2026 15:34 — with GitHub Actions Failure
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.

2 participants