Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b059400
Update README.md
HARSH-Sehrawat Jul 15, 2025
06debd2
Update README.md
HARSH-Sehrawat Jul 15, 2025
eecdfe8
updating K8s manifests
HARSH-Sehrawat Jul 15, 2025
7cc18cb
removed Jenkinsfile
HARSH-Sehrawat Jul 29, 2025
42c8e7c
Terraform files added
HARSH-Sehrawat Jul 29, 2025
3bd8029
Add new directory
Jul 31, 2025
613967a
Added main.tf for ECR
Jul 31, 2025
d2f25d3
Delete .gitkeep
Jul 31, 2025
0370e3c
Added outputs.tf for ECR
Jul 31, 2025
e28e56b
Edit main.tf for ECR
Jul 31, 2025
8fa5242
Delete kind-config.yaml
Jul 31, 2025
6fd371d
Added ingress file.
Aug 1, 2025
bdf52a2
Add backend-hpa
Aug 1, 2025
c0dc1a9
Added frontend-hpa
Aug 1, 2025
c4e9bb1
Added metrics-server file
Aug 1, 2025
8b4c485
Added backend.tf
Aug 1, 2025
9efc98c
Added pipeline for infra provisioning.
Aug 3, 2025
c9a5e58
Added entry point file for CICD pipelines.
Aug 3, 2025
bf60fb9
Edit .gitlab-ci.infra.yml
Aug 3, 2025
71f1bc6
Edit main.tf
Aug 3, 2025
7e2ee27
Edit .gitlab-ci.infra.yml
Aug 3, 2025
7c3347f
Edit .gitlab-ci.infra.yml
Aug 3, 2025
77f3a4e
Edit .gitlab-ci.infra.yml
Aug 3, 2025
f8de708
Edit main.tf
Aug 3, 2025
fa4d7c8
Update 6 files
Aug 3, 2025
da5f615
Update file .gitlab-ci.infra.yml
Aug 3, 2025
a9e83a1
Update file .gitlab-ci.infra.yml
Aug 3, 2025
4dc3c35
Update file .gitlab-ci.infra.yml
Aug 3, 2025
4fe84c5
Update 6 files
Aug 3, 2025
27d1e96
Edit .gitlab-ci.yml
Aug 3, 2025
858f401
Edit .gitlab-ci.deploy.yml
Aug 3, 2025
93e808c
Update file .gitlab-ci.deploy.yml
Aug 3, 2025
ffa6afc
Edit .gitlab-ci.deploy.yml
Aug 3, 2025
e317ef4
Edit .gitlab-ci.deploy.yml
Aug 3, 2025
40ff5fe
Update file .gitlab-ci.deploy.yml
Aug 3, 2025
a43a091
Update 2 files
Aug 3, 2025
5045a2a
Edit .gitlab-ci.deploy.yml
Aug 3, 2025
04338d3
Update 2 files
Aug 3, 2025
c807bfc
Update file .gitlab-ci.deploy.yml
Aug 3, 2025
59fe734
Update file mongo-pv.yaml
Aug 4, 2025
aaf8d60
Update file frontend-ingress.yaml
Aug 4, 2025
e84c9c9
Update file frontend-service.yaml
Aug 4, 2025
cfb262e
Update file frontend-service.yaml
Aug 4, 2025
19b2404
Update file README.md
Aug 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

.devcontainer
node_modules
dist
dist-ssr
Expand All @@ -23,4 +23,17 @@ dist-ssr
*.sln
*.sw?

.env
.env

# === Terraform ===
*.tfstate
*.tfstate.*
.terraform/
.terraform.lock.hcl
crash.log
override.tf
override.tf.json
*_override.tf
*_override.tf.json
.terraform.tfvars
terraform.tfvars
67 changes: 67 additions & 0 deletions .gitlab-ci.deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
stages:
- build
- push
- deploy
Comment on lines +1 to +4
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Normalize line endings to LF

Same CRLF issue as .gitlab-ci.infra.yml; re-commit with Unix line endings to silence YAML lint errors and avoid cross-platform diffs.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)

🤖 Prompt for AI Agents
In .gitlab-ci.deploy.yml at lines 1 to 4, the file uses CRLF line endings
causing YAML lint errors and cross-platform diffs. Convert all line endings in
this file to Unix-style LF line endings and recommit the file to resolve these
issues.


variables:
DOCKER_DRIVER: overlay2
IMAGE_TAG: "v$CI_PIPELINE_ID"

build_backend:
stage: build
script:
- docker build -t $ECR_BACKEND_REPO:$IMAGE_TAG ./backend
tags:
- self-hosted

build_frontend:
stage: build
script:
- docker build -t $ECR_FRONTEND_REPO:$IMAGE_TAG ./frontend
tags:
- self-hosted

push_backend:
stage: push
script:
- aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $ECR_BACKEND_REPO
- docker push $ECR_BACKEND_REPO:$IMAGE_TAG
tags:
- self-hosted

push_frontend:
stage: push
script:
- aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $ECR_FRONTEND_REPO
- docker push $ECR_FRONTEND_REPO:$IMAGE_TAG
tags:
- self-hosted

deploy:
stage: deploy
script:
- aws eks update-kubeconfig --region us-east-2 --name chatapp-cluster
- kubectl config use-context arn:aws:eks:us-east-2:339932683794:cluster/chatapp-cluster
- kubectl apply -f k8s/namespace.yaml
- kubectl apply -f k8s/mongodb-secret.yaml
- kubectl apply -f k8s/mongodb-configmap.yaml
- kubectl apply -f k8s/mongo-pv.yaml
- kubectl apply -f k8s/mongo-pvc.yaml
- kubectl apply -f k8s/mongodb-deployment.yaml
- kubectl apply -f k8s/mongodb-service.yaml
- kubectl apply -f k8s/backend-secrets.yaml
- kubectl apply -f k8s/backend-service.yaml
- sed "s|IMAGE_PLACEHOLDER|$ECR_BACKEND_REPO:$IMAGE_TAG|g" k8s/backend-deployment.yaml > k8s/_backend-deployment.yaml
- kubectl apply -f k8s/_backend-deployment.yaml
- kubectl apply -f k8s/backend-hpa.yaml
- kubectl apply -f k8s/frontend-configmap.yaml
- kubectl apply -f k8s/frontend-service.yaml
- sed "s|IMAGE_PLACEHOLDER|$ECR_FRONTEND_REPO:$IMAGE_TAG|g" k8s/frontend-deployment.yaml > k8s/_frontend-deployment.yaml
- kubectl apply -f k8s/_frontend-deployment.yaml
- kubectl apply -f k8s/frontend-hpa.yaml
- kubectl apply -f k8s/frontend-ingress.yaml
- kubectl apply -f k8s/metrics-server.yaml
only:
- DevOps
tags:
- self-hosted
34 changes: 34 additions & 0 deletions .gitlab-ci.infra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
stages:
- plan
- apply

Comment on lines +1 to +4
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Convert CRLF to LF – current line endings break linters

YAMLlint flags “wrong new line character” because the file is committed with Windows CRLF. While GitLab CI is tolerant, many tools and reviewers aren’t. Re-commit with Unix LF to keep the repo consistent.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)

🤖 Prompt for AI Agents
In .gitlab-ci.infra.yml at lines 1 to 4, the file uses Windows-style CRLF line
endings which cause YAMLlint to flag errors. Convert all line endings in this
file from CRLF to Unix-style LF and recommit to ensure compatibility with
linters and maintain consistency in the repository.

variables:
TF_IN_AUTOMATION: "true"
TF_INPUT: "false"



plan_eks:
stage: plan
script:
- cd infra/eks
- terraform init -reconfigure
- terraform plan -out=tfplan
tags:
- self-hosted
artifacts:
paths:
- infra/eks/tfplan
expire_in: 1 hour


apply_eks:
stage: apply
script:
- cd infra/eks
- terraform init -reconfigure
- terraform apply -auto-approve tfplan
when: manual
needs: ["plan_eks"]
tags:
- self-hosted
3 changes: 3 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include:
#- local: '.gitlab-ci.infra.yml'
- local: '.gitlab-ci.deploy.yml'
41 changes: 0 additions & 41 deletions Jenkinsfile

This file was deleted.

Loading