From db5948450e5a68295b4bf2106adfe2b432838cdd Mon Sep 17 00:00:00 2001 From: shantanu <32015559+Shantanumajan6@users.noreply.github.com> Date: Fri, 23 Feb 2024 20:34:43 +0530 Subject: [PATCH 01/19] Update Jenkinsfile update --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3ce897f..068174c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ - +//updated pipeline { agent { label { From a815a54c113f83c3468f42257e3ac832611e6f3b Mon Sep 17 00:00:00 2001 From: shantanu <32015559+Shantanumajan6@users.noreply.github.com> Date: Fri, 23 Feb 2024 20:35:27 +0530 Subject: [PATCH 02/19] Update Jenkinsfile ewfgwegweg --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 068174c..3ce897f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ -//updated + pipeline { agent { label { From bb9974f4c86a761d639859d6eb72f1f638c482e6 Mon Sep 17 00:00:00 2001 From: shantanu <32015559+Shantanumajan6@users.noreply.github.com> Date: Mon, 9 Dec 2024 08:52:23 +0530 Subject: [PATCH 03/19] Update Jenkinsfile updated code --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3ce897f..2f8b939 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent { label { - label "built-in" + label "built-in-project" customWorkspace "/data/project-myapp" } From 72bfb6dbe2cc3b2023fb5a555faab5fa6641e097 Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Wed, 25 Jun 2025 18:59:13 +0530 Subject: [PATCH 04/19] Update Jenkinsfile --- Jenkinsfile | 48 +----------------------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2f8b939..8d1c8b6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,47 +1 @@ - -pipeline { -agent { -label { - label "built-in-project" - customWorkspace "/data/project-myapp" - - } - } - - stages { - - stage ('CLEAN_OLD_M2') { - - steps { - sh "rm -rf /home/saccount/.m2/repository" - - } - - } - - stage ('MAVEN_BUILD') { - - steps { - - sh "mvn clean package" - - } - - - } - - stage ('COPY_WAR_TO_Server'){ - - steps { - - sh "scp -r target/LoginWebApp.war saccount@10.0.2.51:/data/project/wars" - - } - - } - - - - } - -} + From 5281e4614cf09a312676e0a560c8493c92e75d81 Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Wed, 25 Jun 2025 19:02:49 +0530 Subject: [PATCH 05/19] Update Jenkinsfile --- Jenkinsfile | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8d1c8b6..f9fa115 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1 +1,58 @@ - +pipeline { + agent none + + tools { + maven 'apache-maven-3.9.10' + } + + stages { + + stage('Cloning Git Repo') { + agent { label 'built-in' } + steps { + dir('/mnt/project') { + checkout scm + } + } + } + + stage('Build with Maven') { + agent { label 'built-in' } + steps { + dir('/mnt/project') { + // Fixing path to .m2 directory (it should be relative to the home directory) + sh 'rm -rf ~/.m2/repository' + sh 'mvn clean install' + stash name: 'warfile', includes: 'target/*.war' + } + } + } + + stage('Configure Database Connection') { + agent { label 'built-in' } + steps { + dir('/mnt/project') { + // Updated database URL and credentials in userRegistration.jsp + sh ''' + sed -i 's|jdbc:mysql://localhost:3306/test", "root", "root"|jdbc:mysql://database-1.cmfhccpboiuu.ap-south-1.rds.amazonaws.com:3306/test", "admin", "admin123456"|g' userRegistration.jsp + ''' + } + } + } + + stage('Deploy WAR to Tomcat') { + agent { label 'slave-1' } + steps { + dir('/mnt/project/target') { + unstash name: 'warfile' + sh ''' + cp *.war /mnt/apache-tomcat-10.1.42/webapps/ + chmod -R 777 /mnt/apache-tomcat-10.1.42 + /mnt/apache-tomcat-10.1.42/bin/startup.sh + ''' + } + } + } + + } +} From fb88a1f1578ee6b6e6a7f23f8fda3375d8ceef76 Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Wed, 25 Jun 2025 19:13:50 +0530 Subject: [PATCH 06/19] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f9fa115..3da843a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,7 +31,7 @@ pipeline { stage('Configure Database Connection') { agent { label 'built-in' } steps { - dir('/mnt/project') { + dir('/mnt/project/target/LoginWebApp') { // Updated database URL and credentials in userRegistration.jsp sh ''' sed -i 's|jdbc:mysql://localhost:3306/test", "root", "root"|jdbc:mysql://database-1.cmfhccpboiuu.ap-south-1.rds.amazonaws.com:3306/test", "admin", "admin123456"|g' userRegistration.jsp @@ -41,7 +41,7 @@ pipeline { } stage('Deploy WAR to Tomcat') { - agent { label 'slave-1' } + agent { label 'slave1' } steps { dir('/mnt/project/target') { unstash name: 'warfile' From a980aa37a6d9ef48858f13ee7262015ed782b2b8 Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Wed, 25 Jun 2025 19:22:14 +0530 Subject: [PATCH 07/19] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3da843a..92f1b01 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,7 +43,7 @@ pipeline { stage('Deploy WAR to Tomcat') { agent { label 'slave1' } steps { - dir('/mnt/project/target') { + dir('/mnt/project') { unstash name: 'warfile' sh ''' cp *.war /mnt/apache-tomcat-10.1.42/webapps/ From 78379aded4419913eb9eb4c97a1e4fca71e1f2a9 Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Wed, 25 Jun 2025 19:27:59 +0530 Subject: [PATCH 08/19] Update Jenkinsfile --- Jenkinsfile | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 92f1b01..6ec6bd6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,20 +39,19 @@ pipeline { } } } + - stage('Deploy WAR to Tomcat') { - agent { label 'slave1' } - steps { - dir('/mnt/project') { - unstash name: 'warfile' - sh ''' - cp *.war /mnt/apache-tomcat-10.1.42/webapps/ - chmod -R 777 /mnt/apache-tomcat-10.1.42 - /mnt/apache-tomcat-10.1.42/bin/startup.sh - ''' - } - } - } - + stage('Deploy WAR to Tomcat') { + agent { label 'slave1' } + steps { + unstash name: 'warfile' // This goes into the current workspace by default + sh ''' + cp target/*.war /mnt/apache-tomcat-10.1.42/webapps/ + chmod -R 777 /mnt/apache-tomcat-10.1.42 + /mnt/apache-tomcat-10.1.42/bin/startup.sh + ''' } -} +} + + + } From e262b0928095a1cb747fa717cb22aea95e17c9f5 Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Wed, 25 Jun 2025 19:30:17 +0530 Subject: [PATCH 09/19] Update Jenkinsfile --- Jenkinsfile | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6ec6bd6..cafc8c5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,6 @@ pipeline { agent { label 'built-in' } steps { dir('/mnt/project') { - // Fixing path to .m2 directory (it should be relative to the home directory) sh 'rm -rf ~/.m2/repository' sh 'mvn clean install' stash name: 'warfile', includes: 'target/*.war' @@ -32,26 +31,26 @@ pipeline { agent { label 'built-in' } steps { dir('/mnt/project/target/LoginWebApp') { - // Updated database URL and credentials in userRegistration.jsp sh ''' sed -i 's|jdbc:mysql://localhost:3306/test", "root", "root"|jdbc:mysql://database-1.cmfhccpboiuu.ap-south-1.rds.amazonaws.com:3306/test", "admin", "admin123456"|g' userRegistration.jsp ''' } } } - - stage('Deploy WAR to Tomcat') { - agent { label 'slave1' } - steps { - unstash name: 'warfile' // This goes into the current workspace by default - sh ''' - cp target/*.war /mnt/apache-tomcat-10.1.42/webapps/ - chmod -R 777 /mnt/apache-tomcat-10.1.42 - /mnt/apache-tomcat-10.1.42/bin/startup.sh - ''' + stage('Deploy WAR to Tomcat') { + agent { label 'slave1' } + steps { + unstash name: 'warfile' + sh ''' + echo "Checking WAR files:" + ls -l target + cp target/*.war /mnt/apache-tomcat-10.1.42/webapps/ + chmod -R 777 /mnt/apache-tomcat-10.1.42 + /mnt/apache-tomcat-10.1.42/bin/startup.sh + ''' + } + } + } } - - - } From f0343962e9652968f0a38ecc4458f6fbd3c5a6fd Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Wed, 25 Jun 2025 19:34:24 +0530 Subject: [PATCH 10/19] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index cafc8c5..74b69be 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -46,7 +46,7 @@ pipeline { echo "Checking WAR files:" ls -l target cp target/*.war /mnt/apache-tomcat-10.1.42/webapps/ - chmod -R 777 /mnt/apache-tomcat-10.1.42 + chmod -R 777 /mnt * /mnt/apache-tomcat-10.1.42/bin/startup.sh ''' } From 5788d5779a2ba94a2209d893cd4f8b865f8fc601 Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Wed, 25 Jun 2025 19:39:43 +0530 Subject: [PATCH 11/19] Update Jenkinsfile --- Jenkinsfile | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 74b69be..b24f2c9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,19 +38,18 @@ pipeline { } } - stage('Deploy WAR to Tomcat') { - agent { label 'slave1' } - steps { - unstash name: 'warfile' - sh ''' - echo "Checking WAR files:" - ls -l target - cp target/*.war /mnt/apache-tomcat-10.1.42/webapps/ - chmod -R 777 /mnt * - /mnt/apache-tomcat-10.1.42/bin/startup.sh - ''' - } - } + stage('Deploy WAR to Tomcat') { + agent { label 'slave1' } + steps { + unstash name: 'warfile' + sh ''' + cp target/LoginWebApp.war /mnt/apache-tomcat-10.1.42/webapps/ + chmod 644 /mnt/apache-tomcat-10.1.42/webapps/LoginWebApp.war + /mnt/apache-tomcat-10.1.42/bin/startup.sh + ''' + } +} + } } From 894a5383126a2117ff7f794eec8cdd93ee094c01 Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Wed, 25 Jun 2025 19:56:53 +0530 Subject: [PATCH 12/19] Update Jenkinsfile --- Jenkinsfile | 59 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b24f2c9..e45fe88 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,55 +1,66 @@ pipeline { agent none - tools { - maven 'apache-maven-3.9.10' + environment { + MAVEN_HOME = "/mnt/build-tools/apache-maven-3.9.10" + PATH = "${env.MAVEN_HOME}/bin:${env.PATH}" } stages { - stage('Cloning Git Repo') { - agent { label 'built-in' } + stage('Clone Git Repository') { + agent { label 'built-in' } // Master node steps { dir('/mnt/project') { - checkout scm + git url: 'https://github.com/Shantanumajan6/project.git' } } } - stage('Build with Maven') { + stage('Build WAR on Master') { agent { label 'built-in' } steps { dir('/mnt/project') { sh 'rm -rf ~/.m2/repository' - sh 'mvn clean install' - stash name: 'warfile', includes: 'target/*.war' + sh 'mvn clean package' + stash name: 'warfile', includes: 'target/LoginWebApp.war' } } } - stage('Configure Database Connection') { - agent { label 'built-in' } + stage('Deploy on Slave') { + agent { label 'slave1' } steps { - dir('/mnt/project/target/LoginWebApp') { + dir('/mnt/projects') { + deleteDir() + unstash 'warfile' + + // Place WAR in Tomcat sh ''' - sed -i 's|jdbc:mysql://localhost:3306/test", "root", "root"|jdbc:mysql://database-1.cmfhccpboiuu.ap-south-1.rds.amazonaws.com:3306/test", "admin", "admin123456"|g' userRegistration.jsp + cp target/LoginWebApp.war /mnt/servers/apache-tomcat-9.0.106/webapps/ ''' } } } - stage('Deploy WAR to Tomcat') { - agent { label 'slave1' } - steps { - unstash name: 'warfile' - sh ''' - cp target/LoginWebApp.war /mnt/apache-tomcat-10.1.42/webapps/ - chmod 644 /mnt/apache-tomcat-10.1.42/webapps/LoginWebApp.war - /mnt/apache-tomcat-10.1.42/bin/startup.sh - ''' - } -} - + stage('Update JSP for RDS') { + agent { label 'slave1' } + steps { + sh ''' + sleep 10 + sed -i 's|jdbc:mysql://localhost:3306/test", "root", "root"|jdbc:mysql://database-1.cb48gkq0ufgf.ap-south-1.rds.amazonaws.com:3306/test", "admin", "admin123456"|g' /mnt/servers/apache-tomcat-9.0.106/webapps/LoginWebApp/userRegistration.jsp + ''' + } + } + stage('Start Tomcat on Slave') { + agent { label 'slave1' } + steps { + sh ''' + /mnt/servers/apache-tomcat-9.0.106/bin/shutdown.sh || true + /mnt/servers/apache-tomcat-9.0.106/bin/startup.sh + ''' + } + } } } From 7a977736618d3b5b39b0492a8a79ea0af430e872 Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Wed, 25 Jun 2025 20:01:04 +0530 Subject: [PATCH 13/19] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e45fe88..7e8a6c9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,7 +12,7 @@ pipeline { agent { label 'built-in' } // Master node steps { dir('/mnt/project') { - git url: 'https://github.com/Shantanumajan6/project.git' + git url: 'https://github.com/Chetashree20/project.git' } } } From 916c11854eef704b7e6b63db47f2400134182af9 Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Wed, 25 Jun 2025 20:10:26 +0530 Subject: [PATCH 14/19] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7e8a6c9..e2f6965 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { stage('Clone Git Repository') { agent { label 'built-in' } // Master node steps { - dir('/mnt/project') { + dir('/mnt') { git url: 'https://github.com/Chetashree20/project.git' } } From cc830028396fbb60c515c7e8694c35256ea75929 Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Thu, 29 Jan 2026 15:56:09 +0530 Subject: [PATCH 15/19] Create Dockerfile --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..01dc356 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM tomcat:9-jdk17 +COPY target/*.war /usr/local/tomcat/webapps/LoginWebApp.war From cf98a48f3cea1a3a4615d204283b50a5d5743364 Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Thu, 29 Jan 2026 16:47:41 +0530 Subject: [PATCH 16/19] Update Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 01dc356..14d8a2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,3 @@ FROM tomcat:9-jdk17 COPY target/*.war /usr/local/tomcat/webapps/LoginWebApp.war +EXPOSE 8080 From 59ae09bdc409e7583ef32a6826d7a9eb32840b94 Mon Sep 17 00:00:00 2001 From: Chetashree20 Date: Fri, 30 Jan 2026 18:21:30 +0530 Subject: [PATCH 17/19] Update Dockerfile --- Dockerfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 14d8a2f..b9d7a58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,11 @@ -FROM tomcat:9-jdk17 -COPY target/*.war /usr/local/tomcat/webapps/LoginWebApp.war +FROM tomcat:9.0 + +# remove default apps +RUN rm -rf /usr/local/tomcat/webapps/* + +# copy WAR +COPY target/LoginWebApp.war /usr/local/tomcat/webapps/ROOT.war + EXPOSE 8080 + +CMD ["catalina.sh","run"] From 047496fdb1c12907cc32ac5625182b292625a93d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 3 Feb 2026 15:44:46 +0000 Subject: [PATCH 18/19] Added login feature --- src/main/webapp/success.jsp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/success.jsp b/src/main/webapp/success.jsp index bbc3eca..f556828 100644 --- a/src/main/webapp/success.jsp +++ b/src/main/webapp/success.jsp @@ -4,9 +4,12 @@ You are not logged in
Please Login <%} else { +%> +You are Successfully logged in
+ %> Welcome <%=session.getAttribute("userid")%> Log out <% } -%> \ No newline at end of file +%> From 80c9af6d88b39f57805fcd543267c1429aefd9b8 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 3 Feb 2026 19:12:57 +0000 Subject: [PATCH 19/19] Readme docc added --- README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..09782de --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Login Application + +This project follows GitHub Flow. +All changes are made via feature branches and Pull Requests.