diff --git a/Jenkinsfile-declarative30 b/Jenkinsfile-declarative30 new file mode 100644 index 0000000000..00150c45e7 --- /dev/null +++ b/Jenkinsfile-declarative30 @@ -0,0 +1,95 @@ +pipeline { + agent any + + tools { + maven 'maven 3.9.9' // This should match the exact Maven name configured in Jenkins + } + + environment { + MAVEN_OPTS = '-Dmaven.repo.local=.m2/repository' + } + + stages { + stage('1GetCode') { + steps { + echo 'Cloning the latest application version' + git branch: 'feature', url: 'https://github.com/gozelah3/maven-web-application' + } + } + + stage('3Test+Build') { + steps { + echo 'Running JUnit test cases' + echo 'Testing must pass to create artifacts' + sh 'mvn clean package' + } + } + + stage('4CodeQuality') { + steps { + echo 'Performing Code Quality Analysis' + sh 'mvn sonar:sonar' + } + } + + stage('5uploadNexus') { + steps { + withCredentials([usernamePassword( + credentialsId: 'nexus-creds-id', // Replace with your actual Jenkins credentials ID + usernameVariable: 'NEXUS_USER', + passwordVariable: 'NEXUS_PASS' + )]) { + writeFile file: 'settings.xml', text: """ + + + + nexus + ${env.NEXUS_USER} + ${env.NEXUS_PASS} + + + + """ + sh 'mvn deploy --settings settings.xml' + } + } + } + stage('8deploy2prod') { + steps{ + deploy adapters: [tomcat9(credentialsId: 'TomcatDomiCredentials', path: '', url: 'http://44.204.149.155:8080/')], contextPath: null, war: 'target/*war' + } + } + } + + post { + always { + emailext body: '''Hey guys, +Please check build status. + +Thanks, +Landmark ++1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'Build Notification', to: 'boa-team@gmail.com' + } + + success { + emailext body: '''Hey guys, +Good job, build and deployment is successful. + +Thanks, +Landmark ++1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'Build SUCCESS', to: 'paypal-team@gmail.com' + } + + failure { + emailext body: '''Hey guys, +Build failed. Please resolve issues. + +Thanks, +Landmark ++1 404 453 4870''', recipientProviders: [buildUser(), developers()], subject: 'Build FAILED', to: 'paypal-team@gmail.com' + } + } +} diff --git a/jenkinsfile_aug30 b/jenkinsfile_aug30 new file mode 100644 index 0000000000..4bab99b70e --- /dev/null +++ b/jenkinsfile_aug30 @@ -0,0 +1,38 @@ +node{ + def mavenHome = tool name: 'maven 3.9.9' + stage('1cloneCode'){ + git "https://github.com/gozelah3/maven-web-application" + } + stage('2Test&Build'){ + sh "${mavenHome}/bin/mvn package" + //bat "${mavenHome}/bin/mvn clean package" + } + /* + stage('3codeQuality'){ + sh '/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven_3.9.9/bin/mvn sonar:sonar -Dsonar.scanner.force-deploy=true -DargLine="--add-opens java.base/java.lang=ALL-UNNAMED"' + } + stage('4uploadArtifacts'){ + sh "${mavenHome}/bin/mvn deploy" + } + stage('5deploy2UAT'){ + sh "echo 'deploy to UAT' " + deploy adapters: [tomcat8(credentialsId: 'TomcatDomiCredentials', path: '', url: 'http://184.72.174.131:8080/')], contextPath: null, war: 'target/*war' + } + stage('6approvalGate'){ + sh "echo 'ready for review' " + timeout(time:5, unit:'DAYS') { + input message: 'Application ready for deployment, Please review and approve' + } + } + stage('7deploy2Prod'){ + sh "sleep 50" + deploy adapters: [tomcat8(credentialsId: 'TomcatDomiCredentials', path: '', url: 'http://184.72.174.131:8080/')], contextPath: null, war: 'target/*war' + } + stage('8emailNotification'){ + emailext body: '''Hi all, + +Pls Check build status +Chigo Technologies''', recipientProviders: [buildUser(), developers(), upstreamDevelopers(), contributor(), brokenBuildSuspects(), brokenTestsSuspects()], subject: 'build status', to: 'tesla-app@gmail.com' + } + */ +} diff --git a/jenkinsfile_tesla30 b/jenkinsfile_tesla30 new file mode 100644 index 0000000000..c678dab9c5 --- /dev/null +++ b/jenkinsfile_tesla30 @@ -0,0 +1,36 @@ +node{ + def mavenHome = tool name: 'maven 3.9.9' + stage('1cloneCode'){ + git "https://github.com/gozelah3/maven-web-application" + } + stage('2Test&Build'){ + sh "${mavenHome}/bin/mvn package" + //bat "${mavenHome}/bin/mvn clean package" + } + stage('3codeQuality'){ + sh '/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven_3.9.9/bin/mvn sonar:sonar -Dsonar.scanner.force-deploy=true -DargLine="--add-opens java.base/java.lang=ALL-UNNAMED"' + } + stage('4uploadArtifacts'){ + sh "${mavenHome}/bin/mvn deploy" + } + stage('5deploy2UAT'){ + sh "echo 'deploy to UAT' " + deploy adapters: [tomcat8(credentialsId: 'TomcatDomiCredentials', path: '', url: 'http://184.72.174.131:8080/')], contextPath: null, war: 'target/*war' + } + stage('6approvalGate'){ + sh "echo 'ready for review' " + timeout(time:5, unit:'DAYS') { + input message: 'Application ready for deployment, Please review and approve' + } + } + stage('7deploy2Prod'){ + sh "sleep 50" + deploy adapters: [tomcat8(credentialsId: 'TomcatDomiCredentials', path: '', url: 'http://184.72.174.131:8080/')], contextPath: null, war: 'target/*war' + } + stage('8emailNotification'){ + emailext body: '''Hi all, + +Pls Check build status +Chigo Technologies''', recipientProviders: [buildUser(), developers(), upstreamDevelopers(), contributor(), brokenBuildSuspects(), brokenTestsSuspects()], subject: 'build status', to: 'tesla-app@gmail.com' + } +} diff --git a/pom.xml b/pom.xml index 409f41826b..e8077152a9 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ maven-web-application war - 0.0.2-SNAPSHOT + 0.0.3 maven-web-application @@ -22,7 +22,7 @@ 5.1.2.RELEASE 4.11 1.2.17 - http://10.0.5.201:9000/ + http://172.31.24.240:9000/ admin admin123 UTF-8 @@ -84,31 +84,25 @@ - - javax.servlet - javax.servlet-api - 3.1.0 - provided - nexus Landmark Technologies Releases Nexus Repository - http://98.81.159.237:8081/repository/tesla-releases/ + http://34.202.163.242:8181/mylandmarktech/repository/boafeature-releases/ nexus Landmark Technologies Snapshot Nexus Repository - http://98.81.159.237:8081/repository/tesla-snapshots/ + http://34.202.163.242:8181/mylandmarktech/repository/boafeature-snapshots/ - tesla + fintech-boa @@ -144,7 +138,16 @@ maven-web-application - + + + org.apache.maven.plugins + maven-surefire-plugin + 3.2.5 + + --add-opens java.base/java.lang=ALL-UNNAMED + + + diff --git a/src/main/webapp/jsps/home.jsp b/src/main/webapp/jsps/home.jsp index 63d8de04c9..8649904015 100644 --- a/src/main/webapp/jsps/home.jsp +++ b/src/main/webapp/jsps/home.jsp @@ -9,14 +9,10 @@ -

Welcome to Tesla Web application Project.

-

Landmark Software Solutions (LSS) are developing and supporting quality Software Solutions to millions of clients globally. - We are raising billionaires IT professionals accross the nations of the World. - Landmark Software Solutions (LSS) offers Training for DevOps with Linux, Kubernetes and Cloud, equipping IT Engineers for best performance. - Landmark Technologies, the Pride of Africa. - Class37 DevOps MasterClass started on July 13, 2024. - Class38 DevOps MasterClass will start on Oct 19, 2024. - Please invite all your contacts and friends for this life changing course. +

Welcome to Tesla Web-application Project30 Automation.

+

Landmark Software Solutions (LSS) are developing and supporting quality Software Solutions to millions of clients globally. + We are raising senior IT professionals who will become billionaires, across the nations of the World. + Landmark Technologies, the Pride of Africa.