Skip to content
Open
17 changes: 8 additions & 9 deletions Jenkins-Pipeline-Code/Jenkinsfile-Backend
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pipeline {
agent any
tools {
jdk 'jdk'
nodejs 'nodejs'
}
environment {
Expand All @@ -19,16 +18,16 @@ pipeline {
}
stage('Checkout from Git') {
steps {
git credentialsId: 'GITHUB', url: 'https://github.com/AmanPathak-DevOps/End-to-End-Kubernetes-Three-Tier-DevSecOps-Project.git'
git credentialsId: 'GITHUB', url: 'https://github.com/JatinKishore/End-to-End-Kubernetes-Three-Tier-DevSecOps-Project.git'
}
}
stage('Sonarqube Analysis') {
steps {
dir('Application-Code/backend') {
withSonarQubeEnv('sonar-server') {
sh ''' $SCANNER_HOME/bin/sonar-scanner \
-Dsonar.projectName=three-tier-backend \
-Dsonar.projectKey=three-tier-backend '''
-Dsonar.projectName=backend \
-Dsonar.projectKey=backend '''
}
}
}
Expand Down Expand Up @@ -82,20 +81,20 @@ pipeline {
}
stage('Checkout Code') {
steps {
git credentialsId: 'GITHUB', url: 'https://github.com/AmanPathak-DevOps/End-to-End-Kubernetes-Three-Tier-DevSecOps-Project.git'
git credentialsId: 'GITHUB', url: 'https://github.com/JatinKishore/End-to-End-Kubernetes-Three-Tier-DevSecOps-Project.git'
}
}
stage('Update Deployment file') {
environment {
GIT_REPO_NAME = "End-to-End-Kubernetes-Three-Tier-DevSecOps-Project"
GIT_USER_NAME = "AmanPathak-DevOps"
GIT_USER_NAME = "JatinKishore"
}
steps {
dir('Kubernetes-Manifests-file/Backend') {
withCredentials([string(credentialsId: 'github', variable: 'GITHUB_TOKEN')]) {
sh '''
git config user.email "aman07pathak@gmail.com"
git config user.name "AmanPathak-DevOps"
git config user.email "jatinkm02@gmail.com"
git config user.name "JatinKishore"
BUILD_NUMBER=${BUILD_NUMBER}
echo $BUILD_NUMBER
imageTag=$(grep -oP '(?<=backend:)[^ ]+' deployment.yaml)
Expand All @@ -110,4 +109,4 @@ pipeline {
}
}
}
}
}
17 changes: 8 additions & 9 deletions Jenkins-Pipeline-Code/Jenkinsfile-Frontend
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pipeline {
agent any
tools {
jdk 'jdk'
nodejs 'nodejs'
}
environment {
Expand All @@ -19,16 +18,16 @@ pipeline {
}
stage('Checkout from Git') {
steps {
git credentialsId: 'GITHUB', url: 'https://github.com/AmanPathak-DevOps/End-to-End-Kubernetes-Three-Tier-DevSecOps-Project.git'
git credentialsId: 'GITHUB', url: 'https://github.com/JatinKishore/End-to-End-Kubernetes-Three-Tier-DevSecOps-Project.git'
}
}
stage('Sonarqube Analysis') {
steps {
dir('Application-Code/frontend') {
withSonarQubeEnv('sonar-server') {
sh ''' $SCANNER_HOME/bin/sonar-scanner \
-Dsonar.projectName=three-tier-frontend \
-Dsonar.projectKey=three-tier-frontend '''
-Dsonar.projectName=frontend \
-Dsonar.projectKey=frontend '''
}
}
}
Expand Down Expand Up @@ -82,20 +81,20 @@ pipeline {
}
stage('Checkout Code') {
steps {
git credentialsId: 'GITHUB', url: 'https://github.com/AmanPathak-DevOps/End-to-End-Kubernetes-Three-Tier-DevSecOps-Project.git'
git credentialsId: 'GITHUB', url: 'https://github.com/JatinKishore/End-to-End-Kubernetes-Three-Tier-DevSecOps-Project.git'
}
}
stage('Update Deployment file') {
environment {
GIT_REPO_NAME = "End-to-End-Kubernetes-Three-Tier-DevSecOps-Project"
GIT_USER_NAME = "AmanPathak-DevOps"
GIT_USER_NAME = "JatinKishore"
}
steps {
dir('Kubernetes-Manifests-file/Frontend') {
withCredentials([string(credentialsId: 'github', variable: 'GITHUB_TOKEN')]) {
sh '''
git config user.email "aman07pathak@gmail.com"
git config user.name "AmanPathak-DevOps"
git config user.email "jatinkm02@gmail.com"
git config user.name "JatinKishore"
BUILD_NUMBER=${BUILD_NUMBER}
echo $BUILD_NUMBER
imageTag=$(grep -oP '(?<=frontend:)[^ ]+' deployment.yaml)
Expand All @@ -110,4 +109,4 @@ pipeline {
}
}
}
}
}
2 changes: 1 addition & 1 deletion Kubernetes-Manifests-file/Backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
- name: ecr-registry-secret
containers:
- name: api
image: 407622020962.dkr.ecr.us-east-1.amazonaws.com/backend:1
image: 820242902661.dkr.ecr.us-east-1.amazonaws.com/backend:4
imagePullPolicy: Always
env:
- name: MONGO_CONN_STR
Expand Down
7 changes: 3 additions & 4 deletions Kubernetes-Manifests-file/Database/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ kind: PersistentVolumeClaim
metadata:
name: mongo-volume-claim
namespace: three-tier
spec:
accessModes:
spec:
accessModes:
- ReadWriteOnce
storageClassName: ""
resources:
requests:
storage: 1Gi
storage: 1Gi
4 changes: 2 additions & 2 deletions Kubernetes-Manifests-file/Frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ spec:
- name: ecr-registry-secret
containers:
- name: frontend
image: 407622020962.dkr.ecr.us-east-1.amazonaws.com/frontend:3
image: 820242902661.dkr.ecr.us-east-1.amazonaws.com/frontend:7
imagePullPolicy: Always
env:
- name: REACT_APP_BACKEND_URL
value: "http://amanpathakdevops.study/api/tasks"
value: "/api/tasks"
ports:
- containerPort: 3000
4 changes: 1 addition & 3 deletions Kubernetes-Manifests-file/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ metadata:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
# alb.ingress.kubernetes.io/subnets: "subnet-0aa439b4ddafcca10,subnet-0b95df318219145ca,subnet-0ccca36474902829a"
spec:
ingressClassName: alb
rules:
- host: amanpathakdevops.study
http:
- http:
paths:
- path: /api
pathType: Prefix
Expand Down