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

feat: add deployment environments #654

Closed
wants to merge 3 commits into from
Closed

Conversation

JSPRH
Copy link
Contributor

@JSPRH JSPRH commented Feb 1, 2024

Description

Add the deployment infrastructure for next and prod environments.

Next: next.kordis-leitstelle.de | api.next.kordis-leitstelle.de
Prod: app.kordis-leitstelle.de | api.kordis-leitstelle.de

Todo:

  • Note deployment flow possibilities
  • Generate deployment credentials for pipeline
  • Collect commands for deployment
  • Setup deployment pipelines
  • Write ADR for infrastructure setup

Deployment options

1. Via Tags

  • Everything happens in the kordis-leitstelle/kordis repo
  • Every push to main triggers a pipeline setting the image on the next overlay and deploys that
  • Tagging is done by hand and triggers a pipeline tagging the current image with the version tag and setting it on the prod overlay and deploys that
  • Downside: We don't have the tags of containers in version control however this is not really an issue as the tag is either the commit sha or the version tag

2. Via Tags but prod deployments are PRs

  • For next stage same as in option 1
  • Deploying to production works via PR (or similar)
    • Within this PR, the tags of the container images are set to the version which will be created by the deployment
    • The PR pipeline, upon merging, tags the containers with the version tag and deploys overlay prod

3. Via kordis-leitstelle/infrastructure

  • We move all kordis infrastructure over to the kordis-leitstelle/infrastructure repository, which then holds responsibility for deploying
  • Every push to main triggers a pipeline in the infrastructure repo, creating a commit for setting the image tags in the overlay and deploys, same for production deployments via tags
  • Upside: This repo remains more "clean" from operations and focuses on the software; we version control our infrastructure via GitOps

Deployment commands

Set container images: kustomize edit set image kordis-api=ghcr.io/kordis-leitstelle/kordis-api:8683454f374b5989ae30882db5b584152bab715a

Checklist:

  • The title of this PR and the commit history is conform with
    the Conventional Commits specification.
  • I have performed a self-review of my own code.
  • My changes generate no new warnings, SonarCloud reports no Vulnerabilities, Bugs or Code Smells.
  • I have added tests (unit and E2E if user-facing) that prove my fix is effective or that my feature works,
    Coverage > 80% and not less than the current coverage of the main branch.
  • The PR branch is up-to-date with the base branch. In case you merged main into your feature branch, make sure you have run the latest NX migrations (nx migrate --run-migrations).

@JSPRH JSPRH force-pushed the feat-add-next-environment branch from 72b4c62 to d78f7b9 Compare February 1, 2024 12:07
Copy link

sonarqubecloud bot commented Feb 1, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@JSPRH
Copy link
Contributor Author

JSPRH commented Feb 12, 2024

@JSPRH JSPRH closed this Feb 12, 2024
@JSPRH JSPRH deleted the feat-add-next-environment branch February 18, 2024 16:56
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