Skip to content

Commit 4a253c4

Browse files
Update README.md with detailed GitOps deployment documentation
1 parent 5374e2d commit 4a253c4

File tree

1 file changed

+70
-51
lines changed

1 file changed

+70
-51
lines changed

README.md

Lines changed: 70 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This project demonstrates a complete GitOps-style deployment of a Spring Boot +
66

77
## Project Structure
88

9-
9+
```
1010
.
1111
├── app # Spring Boot application (Dockerized)
1212
├── helm # Helm chart for production deployments
@@ -22,72 +22,91 @@ This project demonstrates a complete GitOps-style deployment of a Spring Boot +
2222
│ ├── helm-ci.yaml
2323
│ └── kustomize-ci.yaml
2424
└── dependabot.yaml # Dependency automation
25+
```
2526

27+
---
2628

29+
## Deployment Strategies
2730

28-
Deployment Strategies
31+
### Kustomize – For Development Environments
32+
- Manages environment-specific configurations using overlays (`dev`, `stage`, etc.).
33+
- Uses patch files (`patch-deployment-image.yaml`, etc.) to inject settings.
34+
- CI builds Docker image and automatically updates Kustomize overlays with the new image tag.
35+
- Image tag changes are pushed to a dedicated branch (`auto/kustomize-update`).
2936

30-
Kustomize – For Development Environments
31-
• Manages environment-specific configurations using overlays (dev, stage, etc.).
32-
• Uses patch files (patch-deployment-image.yaml, etc.) to inject settings.
33-
CI builds Docker image and automatically updates Kustomize overlays with the new image tag.
34-
Image tag changes are pushed to a dedicated branch (auto/kustomize-update).
37+
### Helm – For Production
38+
- Used for production-grade deployments with templated configuration.
39+
- Helm chart located in `helm/springboot-postgres-prod`.
40+
- CI builds and pushes Docker image on `main` branch updates.
41+
- Image tag is updated in `values.yaml` and pushed to a separate branch (`auto/helm-update`).
3542

36-
Helm – For Production
37-
• Used for production-grade deployments with templated configuration.
38-
• Helm chart located in helm/springboot-postgres-prod.
39-
• CI builds and pushes Docker image on main branch updates.
40-
• Image tag is updated in values.yaml and pushed to a separate branch (auto/helm-update).
43+
---
4144

42-
45+
## Branching Strategy
4346

44-
Branching Strategy
47+
### `main`
48+
- Protected branch for production.
49+
- Triggers **Helm CI** on push.
50+
- Only accepts Pull Requests.
4551

46-
main
47-
• Protected branch for production.
48-
Triggers Helm CI on push.
49-
• Only accepts Pull Requests.
52+
### `development`
53+
- Integration branch.
54+
- Triggers **Kustomize CI** on push.
55+
- Represents the latest working state of development.
5056

51-
development
52-
• Integration branch.
53-
• Triggers Kustomize CI on push.
54-
• Represents the latest working state of development.
57+
### `feature/*`
58+
- Feature development.
59+
- Merged into `development`.
5560

56-
feature/*
57-
• Feature development.
58-
• Merged into development.
61+
### `auto/kustomize-update`
62+
- Auto-managed branch.
63+
- CI pushes updated image tags to `kustomize/overlays/dev/patch-deployment-image.yaml`.
5964

60-
auto/kustomize-update
61-
Auto-managed branch.
62-
CI pushes updated image tags to kustomize/overlays/dev/patch-deployment-image.yaml.
65+
### `auto/helm-update`
66+
- Auto-managed branch.
67+
- CI pushes updated image tag to `helm/springboot-postgres-prod/values.yaml`.
6368

64-
auto/helm-update
65-
• Auto-managed branch.
66-
• CI pushes updated image tag to helm/springboot-postgres-prod/values.yaml.
69+
---
6770

68-
CI/CD Overview :
71+
## CI/CD Overview
6972

73+
| Tool | Purpose | Trigger Branches |
74+
|-------------------|----------------------------------------------|---------------------------|
75+
| `kustomize-ci.yaml` | Builds Docker image, updates dev overlay | `feature/*`, `development`|
76+
| `helm-ci.yaml` | Builds Docker image, updates Helm chart | `main` |
7077

71-
Docker Image
72-
• Docker image is built from /app and pushed to DockerHub.
73-
• Image tag is dynamically generated in CI.
78+
- Docker image is tagged as: `branchname-<shortsha>`, e.g., `feature-login-abc1234`.
7479

75-
80+
---
81+
82+
## Docker Image
83+
84+
- Docker image is built from `/app` and pushed to DockerHub.
85+
- Image tag is dynamically generated in CI.
86+
87+
---
88+
89+
## Prerequisites
90+
91+
- GitHub PAT with `repo` scope (for pushing commits via Actions).
92+
- DockerHub credentials stored in repository secrets:
93+
- `DOCKERHUB_USERNAME`
94+
- `DOCKERHUB_TOKEN`
95+
- Git config secrets:
96+
- `GIT_USER_NAME`
97+
- `GIT_USER_EMAIL`
98+
- `GH_PAT` (used in CI for authenticated pushes)
99+
100+
---
101+
102+
## Future Enhancements
103+
104+
- Add staging environment overlay in Kustomize.
105+
- Implement CD using ArgoCD or Flux.
106+
- Add unit and integration tests in CI.
107+
- Add Helm chart versioning and publishing.
108+
109+
---
76110

77-
Prerequisites
78-
• GitHub PAT with repo scope (for pushing commits via Actions).
79-
• DockerHub credentials stored in repository secrets:
80-
• DOCKERHUB_USERNAME
81-
• DOCKERHUB_TOKEN
82-
• Git config secrets:
83-
• GIT_USER_NAME
84-
• GIT_USER_EMAIL
85-
• GH_PAT (used in CI for authenticated pushes)
86111

87-
88112

89-
Future Enhancements
90-
• Add staging environment overlay in Kustomize.
91-
• Implement CD using ArgoCD or Flux.
92-
• Add unit and integration tests in CI.
93-
• Add Helm chart versioning and publishing.

0 commit comments

Comments
 (0)