diff --git a/Jenkinsfile b/Jenkinsfile index 82d63ae784..9e11ee68ed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ node { - def mavenHome = tool name: "maven3.6.2" + def mavenHome = tool name: "maven3.8.6" echo "GitHub BranhName ${env.BRANCH_NAME}" echo "Jenkins Job Number ${env.BUILD_NUMBER}" diff --git a/pipeline-declarative b/pipeline-declarative new file mode 100644 index 0000000000..d22e076dd6 --- /dev/null +++ b/pipeline-declarative @@ -0,0 +1,59 @@ +pipeline{ + agent any + tools { + maven "maven3.8.6" + } + stages { +stage('1cloning'){ + steps{ + sh "echo 'cloning the latest application version' " + git credentialsId: 'jkgitcred', url: 'https://github.com/christinedee/maven-web-application.git' //for private repo, generate pipeline syntax + //git "repolink" or sh "git clone repolink" only works for public repositories + } +} +stage('2Test+Build'){ +steps{ + sh "echo 'running JUnit-test-cases' " + sh "echo 'testing must be passed to create artifacts' " + sh "mvn clean package" +} +} +stage('3Codequality'){ + steps{ + sh "echo 'performing code quality analysis with sonarQb' " + sh "mvn sonar:sonar" + } +} + +stage('4uploadNexus'){ + steps{ + sh "echo 'uploading artifacts to nexus' " + sh "mvn deploy" + } +} +stage('5deploy2uat'){ + steps{ + deploy adapters: [tomcat9(credentialsId: 'deployment', path: '', url: 'http://54.215.245.202:8080/')], contextPath: '/opt/webapps', war: 'target/*war' + } + +} + +stage('6deploy2prod'){ + steps{ + deploy adapters: [tomcat9(credentialsId: 'deployment', path: '', url: 'http://54.215.245.202:8080/')], contextPath: '/opt/webapps', war: 'target/*war' + } +} +} + + post { + always{ + emailext body: 'check build status', recipientProviders: [buildUser(), contributor(), developers(), previous(), upstreamDevelopers()], subject: 'success', to: 'nayalea353@gmail.com' + } + success{ + emailext body: 'build and deployment is successful', recipientProviders: [buildUser(), contributor(), developers(), previous(), upstreamDevelopers()], subject: 'success', to: 'nayalea353@gmail.com' + } + failure{ + emailext body: 'build failed, check pipeline script', recipientProviders: [buildUser(), contributor(), developers(), previous(), upstreamDevelopers()], subject: 'success', to: 'nayalea353@gmail.com' + } + } +} diff --git a/pom.xml b/pom.xml index 240a0c2841..0169c45d53 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 5.1.2.RELEASE 4.11 1.2.17 - http:3.96.196.171:9000/ + http:172.31.17.108:9000/ admin admin UTF-8 @@ -98,13 +98,13 @@ nexus Landmark Technologies Releases Nexus Repository - http://35.174.19.3:8081/repository/amazon-release/ + http://52.9.37.93:8081/repository/pipe-releases/ nexus Landmark Technologies Snapshot Nexus Repository - http://35.174.19.3:8081/repository/amazon-snapshot/ + http://52.9.37.93:8081/repository/pipe-snapshots/