From acfabbb9fabff8ef82adec1c6fa1c24dd9cd983c Mon Sep 17 00:00:00 2001 From: ajaysingh3200 <66829002+ajaysingh3200@users.noreply.github.com> Date: Wed, 5 Nov 2025 17:11:29 +0000 Subject: [PATCH 1/4] Update Django app image in docker-compose --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 83c261914..55b19a0ae 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: django_app: build: context: . - image: django_app + image: "ajaysingh3200/notes-app" container_name: "django_cont" ports: - "8000:8000" From 97b30c66307306b336c31215c6683d460d8bdba2 Mon Sep 17 00:00:00 2001 From: ajaysingh3200 <66829002+ajaysingh3200@users.noreply.github.com> Date: Wed, 5 Nov 2025 21:03:10 +0000 Subject: [PATCH 2/4] Update Jenkinsfile --- Jenkinsfile | 53 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index aa56edcfc..cf51548b9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,29 +1,42 @@ -@Library('Shared')_ -pipeline{ - agent { label 'dev-server'} - - stages{ - stage("Code clone"){ - steps{ - sh "whoami" - clone("https://github.com/LondheShubham153/django-notes-app.git","main") +@Library("Shared") _ + +pipeline { + agent { label "vinod" } + + stages { + stage("Hello") { + steps { + script { + hello() } } - stage("Code Build"){ - steps{ - dockerbuild("notes-app","latest") - } + } + stage("Code") { + steps { + script { + clone("https://github.com/ajaysingh3200/django-notes-app.git","main") + } + } } - stage("Push to DockerHub"){ - steps{ - dockerpush("dockerHubCreds","notes-app","latest") + stage("Build") { + steps { + script { + docker_build("notes-app","latest","ajaysingh3200") + } } } - stage("Deploy"){ - steps{ - deploy() + stage('Push to DockerHub') { + steps { + script { + docker_push("notes-app","latest","ajaysingh3200") + } + } + } + stage("Deploy") { + steps { + echo "Deploying the application" + sh "docker compose up -d" } } - } } From da2026df08eb39d49273836ae32a0761d7d7b327 Mon Sep 17 00:00:00 2001 From: ajaysingh3200 <66829002+ajaysingh3200@users.noreply.github.com> Date: Wed, 5 Nov 2025 21:11:10 +0000 Subject: [PATCH 3/4] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cf51548b9..d0a55297e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ -@Library("Shared") _ + @Library("Shared") _ pipeline { agent { label "vinod" } @@ -35,7 +35,7 @@ pipeline { stage("Deploy") { steps { echo "Deploying the application" - sh "docker compose up -d" + sh "docker compose down && docker compose up -d" } } } From a89d944fbf588461acdb8957cb90adeb825a6595 Mon Sep 17 00:00:00 2001 From: ajaysingh3200 Date: Thu, 6 Nov 2025 17:20:27 +0000 Subject: [PATCH 4/4] changes made in readme file --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 731e2a105..a47689bb8 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,5 @@ Install Nginx reverse proxy to make this application available `sudo apt-get update` `sudo apt install nginx` + +########################################################## \ No newline at end of file