Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LGA-3086: Setup CI/CD #3

Merged
merged 98 commits into from
May 23, 2024
Merged

LGA-3086: Setup CI/CD #3

merged 98 commits into from
May 23, 2024

Conversation

said-moj
Copy link
Contributor

@said-moj said-moj commented May 14, 2024

What does this pull request do?

Adds a CI/CD Pipeline using GitHub Actions' workflows

Important

All ingress hosts are only accessible whilst using the Global Protect VPN.

Feature Branch Pipeline

Screenshot 2024-05-19 at 14 40 31 All pushes to any branches, except main, trigger the feature branch pipeline, which performs the following jobs:

Static Analysis:

  • Runs Ruff formatting

Testing:

  • Runs Pytest
  • Outputs results of Pytest in an artefact

Build:

  • Runs docker build creating an image with a tag relating to the latest commit sha of the branch.
  • Runs docker push pushing the image to the AWS Elastic Container Registry in the laa-access-civil-legal-aid-production namespace.

Deploy Dev:

  • Installs or updates a Helm release, named after the branch.
  • Requires only the static analysis step to pass.
  • This creates a new release for each feature branch, with it's own deployment, service and ingress
  • Ingress host is given by: [branch name]-access-cla.cloud-platform.service.gov.uk

Deploy UAT:

Release to staging & production

Screenshot 2024-05-19 at 15 16 51 Once a feature has been merged into main the release pipeline will run, performing the following jobs:

Static Analysis

  • Runs Ruff formatting

Testing

  • Runs Pytest
  • Outputs results of Pytest in an artefact

Build

  • Requires both the static analysis and testing steps to pass
  • Uses docker to build and push the image to the ECR

Deploy Staging:

Deploy Production:

Clean up dev release

Screenshot 2024-05-19 at 15 22 26

Once a Pull Request has been closed, or merged in main, the 'Clean up' workflow will run. This uninstalls the feature's Helm chart from the dev namespace, removing all deployments, ingresses and pods.

Any other changes that would benefit highlighting?

Adds a Flask app which returns the text "Hello, World!" on the "/" route to test the deployment and ingress works as expected.

Checklist

  • Provided JIRA ticket number in the title, e.g. "LGA-152: Sample title"

@said-moj said-moj requested a review from a team as a code owner May 14, 2024 09:09
@said-moj said-moj force-pushed the feature/LGA-3086-ci-cd-setup branch 3 times, most recently from 2f7dba7 to f7c3582 Compare May 14, 2024 09:45
@said-moj said-moj force-pushed the feature/LGA-3086-ci-cd-setup branch 3 times, most recently from 9b8e722 to ee285f3 Compare May 14, 2024 11:19
@said-moj said-moj force-pushed the feature/LGA-3086-ci-cd-setup branch from ee285f3 to ec55a4f Compare May 14, 2024 11:31
@BenMillar-MOJ BenMillar-MOJ force-pushed the feature/LGA-3086-ci-cd-setup branch from c23bc5e to ddfd7e4 Compare May 14, 2024 14:50
@BenMillar-MOJ BenMillar-MOJ force-pushed the feature/LGA-3086-ci-cd-setup branch from ddfd7e4 to 6c265b2 Compare May 14, 2024 14:51
Copy link

@Pheonnexx Pheonnexx left a comment

Choose a reason for hiding this comment

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

LGTM good catch by Jav on somethings!

Copy link
Contributor

@digitalali-moj digitalali-moj left a comment

Choose a reason for hiding this comment

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

Legend.

@BenMillar-MOJ BenMillar-MOJ merged commit 4500c93 into main May 23, 2024
5 checks passed
@BenMillar-MOJ BenMillar-MOJ deleted the feature/LGA-3086-ci-cd-setup branch May 23, 2024 10:04
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.

4 participants