diff --git a/Jenkinsfiles-declarative b/Jenkinsfiles-declarative new file mode 100644 index 0000000000..831b416f73 --- /dev/null +++ b/Jenkinsfiles-declarative @@ -0,0 +1,63 @@ +pipeline{ + agent any + tools { + maven "maven3.8.6" + } + stages { + stage('1GetCode'){ + steps{ + sh "echo 'cloning the latest application version' " + git branch: 'feature', credentialsId: 'GitHubCredentials', url: 'https://github.com/annkessy/maven-web-application' + } + } + stage('3Test+Build'){ + steps{ + sh "echo 'running JUnit-test-cases' " + sh "echo 'testing must pass to create artifacts ' " + sh "mvn clean package" + } + } + stage('4CodeQuality'){ + steps{ + sh "echo 'Perfoming CodeQualityAnalysis' " + sh "mvn sonar:sonar" + } + } + stage('5uploadNexus'){ + steps{ + sh "mvn deploy" + } + } + stage('8deploy2prod'){ + steps{ + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://13.57.51.137: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: 'success', to: 'paypal-team@gmail.com' + } + success{ + emailext body: '''Hey guys +Good job build and deployment is successful. + +Thanks +Annkessy ++1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'fintech-team@gmail.com' + } + failure{ + emailext body: '''Hey guys +Build failed. Please resolve issues. + +Thanks +Annkessy ++1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'fintech-team@gmail.com' + } + } +} diff --git a/Jenkinsfiles-declarative29 b/Jenkinsfiles-declarative29 new file mode 100644 index 0000000000..831b416f73 --- /dev/null +++ b/Jenkinsfiles-declarative29 @@ -0,0 +1,63 @@ +pipeline{ + agent any + tools { + maven "maven3.8.6" + } + stages { + stage('1GetCode'){ + steps{ + sh "echo 'cloning the latest application version' " + git branch: 'feature', credentialsId: 'GitHubCredentials', url: 'https://github.com/annkessy/maven-web-application' + } + } + stage('3Test+Build'){ + steps{ + sh "echo 'running JUnit-test-cases' " + sh "echo 'testing must pass to create artifacts ' " + sh "mvn clean package" + } + } + stage('4CodeQuality'){ + steps{ + sh "echo 'Perfoming CodeQualityAnalysis' " + sh "mvn sonar:sonar" + } + } + stage('5uploadNexus'){ + steps{ + sh "mvn deploy" + } + } + stage('8deploy2prod'){ + steps{ + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://13.57.51.137: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: 'success', to: 'paypal-team@gmail.com' + } + success{ + emailext body: '''Hey guys +Good job build and deployment is successful. + +Thanks +Annkessy ++1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'fintech-team@gmail.com' + } + failure{ + emailext body: '''Hey guys +Build failed. Please resolve issues. + +Thanks +Annkessy ++1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'fintech-team@gmail.com' + } + } +} diff --git a/Jenkinsfiles-scripted29 b/Jenkinsfiles-scripted29 new file mode 100644 index 0000000000..aa6ec32b72 --- /dev/null +++ b/Jenkinsfiles-scripted29 @@ -0,0 +1,40 @@ +node{ + def mavenHome = tool name: 'maven3.8.6' + stage('1cloneCode'){ + git "https://github.com/LandmakTechnology/maven-web-application" + } + stage('2Test&Build'){ + sh "${mavenHome}/bin/mvn clean package" + //bat "${mavenHome}/bin/mvn clean package" + } + stage('3codeQuality'){ + sh "${mavenHome}/bin/mvn clean sonar:sonar" + } + stage('4uploadArtifacts'){ + //sh "${mavenHome}/bin/mvn deploy" + //http://52.53.227.31:8191/landmark/repository/tesla-fe-snapshots/ + //http://52.53.227.31:8191/landmark/repository/tesla-fe-releases/ + // vi pom.xml and added repository details + // vi setting.xml and add AUTHENTICATION details + } + stage('5deploy2UAT'){ + sh "echo 'deploy to UAT' " + deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.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'){ + deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war' + } + stage('8emailNotification'){ + emailext body: '''Hi All, + +Check Build status. + +Landmark Technologies''', recipientProviders: [buildUser(), developers(), upstreamDevelopers(), brokenBuildSuspects(), brokenTestsSuspects(), contributor()], subject: 'build status', to: 'tesla-app@gmail.com' + } +} diff --git a/pom.xml b/pom.xml index 240a0c2841..1d793bcbe6 100644 --- a/pom.xml +++ b/pom.xml @@ -1,154 +1,154 @@ - - 4.0.0 - - com.mt - maven-web-application - war - 0.0.1-SNAPSHOT - - maven-web-application - - Maven Web Project for Java Project - - - Landmark Technologies - http://landmarktechnologies.com/ - - - - 1.8 - 5.1.2.RELEASE - 4.11 - 1.2.17 - http:3.96.196.171:9000/ - admin - admin - UTF-8 - UTF-8 - - - - - - - org.json - json - 20160212 - - - - - junit - junit - 3.8.1 - test - - - - javax.servlet - javax.servlet-api - 3.1.0 - provided - - - - org.mockito - mockito-core - 1.9.5 - test - - - - - - org.springframework - spring-core - ${spring.version} - - - org.springframework - spring-web - ${spring.version} - - - org.springframework - spring-webmvc - ${spring.version} - - - org.springframework - spring-context - ${spring.version} - - - - - - javax.servlet - javax.servlet-api - 3.1.0 - provided - - - - - - - - nexus - Landmark Technologies Releases Nexus Repository - http://35.174.19.3:8081/repository/amazon-release/ - - - - nexus - Landmark Technologies Snapshot Nexus Repository - http://35.174.19.3:8081/repository/amazon-snapshot/ - - - - - - Landmark - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.3 - - ${jdk.version} - ${jdk.version} - - - - - org.eclipse.jetty - jetty-maven-plugin - 9.2.11.v20150529 - - 10 - - /maven-web-application - - - - - - org.apache.maven.plugins - maven-eclipse-plugin - 2.9 - - true - true - 2.0 - maven-web-application - - - - - - - - + + 4.0.0 + + com.mt + maven-web-application + war + 0.0.1-SNAPSHOT + + maven-web-application + + Maven Web Project for Java Project + + + Landmark Technologies + http://landmarktechnologies.com/ + + + + 1.8 + 5.1.2.RELEASE + 4.11 + 1.2.17 + http://3.101.65.190:9000/ + admin + admin + UTF-8 + UTF-8 + + + + + + + org.json + json + 20160212 + + + + + junit + junit + 3.8.1 + test + + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + + org.mockito + mockito-core + 1.9.5 + test + + + + + + org.springframework + spring-core + ${spring.version} + + + org.springframework + spring-web + ${spring.version} + + + org.springframework + spring-webmvc + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + + + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + + + + + + nexus + Landmark Technologies Releases Nexus Repository + http://54.67.81.71:8191/landmark/repository/paypal-releases/ + + + + nexus + Landmark Technologies Snapshot Nexus Repository + http://54.67.81.71:8191/landmark/repository/paypal-snapshots/ + + + + + + Landmark + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + ${jdk.version} + ${jdk.version} + + + + + org.eclipse.jetty + jetty-maven-plugin + 9.2.11.v20150529 + + 10 + + /maven-web-application + + + + + + org.apache.maven.plugins + maven-eclipse-plugin + 2.9 + + true + true + 2.0 + maven-web-application + + + + + + + +