From f0adf9ab66540929dd853cc5dad658e519a364a6 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Fri, 9 Sep 2022 16:03:34 +0530 Subject: [PATCH 01/30] Create settings.xml --- settings.xml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 settings.xml diff --git a/settings.xml b/settings.xml new file mode 100644 index 0000000000..072682ae88 --- /dev/null +++ b/settings.xml @@ -0,0 +1,5 @@ + + jenkins_nexus_user + jenkins_nexus_user + admin@123 + From 7ce37d45d836a33e6a2541aaa347eb05df6032fa Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Fri, 9 Sep 2022 16:09:24 +0530 Subject: [PATCH 02/30] Added Repository --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index 93eeb2de66..be8ffb1cd1 100644 --- a/pom.xml +++ b/pom.xml @@ -22,6 +22,11 @@ + + jenkins_nexus_user + Maven_Nexus_Repo + http://54.91.22.110:8081/repository/Maven-Hosted/ + site-server Test Project Site From 01896522d93e6fb312315f0fb4a8df26156553e2 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Fri, 9 Sep 2022 17:25:38 +0530 Subject: [PATCH 03/30] name updated --- settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.xml b/settings.xml index 072682ae88..ab4bc2f0a5 100644 --- a/settings.xml +++ b/settings.xml @@ -1,5 +1,5 @@ jenkins_nexus_user - jenkins_nexus_user + jenkins admin@123 From 9c7ebe05e09dc32f796432502b28129591c52484 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Fri, 9 Sep 2022 17:30:10 +0530 Subject: [PATCH 04/30] updated to nexus --- settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.xml b/settings.xml index ab4bc2f0a5..445ea810ce 100644 --- a/settings.xml +++ b/settings.xml @@ -1,5 +1,5 @@ - jenkins_nexus_user + nexus jenkins admin@123 From f47ed070a738683e8882c254d67bf575b869f2e5 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Fri, 9 Sep 2022 17:31:50 +0530 Subject: [PATCH 05/30] updated repo --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index be8ffb1cd1..69c243b0d8 100644 --- a/pom.xml +++ b/pom.xml @@ -23,8 +23,8 @@ - jenkins_nexus_user - Maven_Nexus_Repo + Maven-Hosted + Maven-Hosted http://54.91.22.110:8081/repository/Maven-Hosted/ From 171684f14c0772aefcc7bba1d29bf151886488cb Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Fri, 9 Sep 2022 17:33:26 +0530 Subject: [PATCH 06/30] Maven updated --- settings.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/settings.xml b/settings.xml index 445ea810ce..eb71d89528 100644 --- a/settings.xml +++ b/settings.xml @@ -1,5 +1,7 @@ + - nexus + Maven-Hosted jenkins admin@123 + From 9edc37735e23724ee4e365347c444204b2b8255b Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Fri, 9 Sep 2022 17:47:12 +0530 Subject: [PATCH 07/30] Newsettings.xml --- settings.xml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/settings.xml b/settings.xml index eb71d89528..7d69b1bda2 100644 --- a/settings.xml +++ b/settings.xml @@ -1,7 +1,25 @@ - - +; + + Maven-Hosted jenkins admin@123 - - + + + + + mule + + + + Maven-Hosted + jenkins + http://54.91.22.110:8081/repository/Maven-Hosted/; + default + + + + + + From b3de47bba02d4f47a79c54b8677f55bc374fdf22 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Mon, 12 Sep 2022 11:30:00 +0530 Subject: [PATCH 08/30] Test2Jenkinsfile --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000..fb3607c2b3 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,10 @@ +pipeline { + agent any + stages { + stage('Hello from Branch2') { + steps { + echo "Branch=Test2" + } + } + } +} From fe9f8e53ba774ad7cf1641eefd92027b47f42400 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Mon, 12 Sep 2022 12:01:34 +0530 Subject: [PATCH 09/30] Repo_updated --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 69c243b0d8..d6082047f3 100644 --- a/pom.xml +++ b/pom.xml @@ -23,9 +23,9 @@ - Maven-Hosted + nexus Maven-Hosted - http://54.91.22.110:8081/repository/Maven-Hosted/ + http://34.236.152.13:8081/repository/Maven-Hosted/ site-server From 7d520cd206d458fc58ab97c74ad58ef02290eb6f Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Mon, 12 Sep 2022 12:02:35 +0530 Subject: [PATCH 10/30] settings.xml file updated --- settings.xml | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/settings.xml b/settings.xml index 7d69b1bda2..a310ec7e50 100644 --- a/settings.xml +++ b/settings.xml @@ -1,25 +1,5 @@ -; - - - Maven-Hosted - jenkins - admin@123 - - - - - mule - - - - Maven-Hosted - jenkins - http://54.91.22.110:8081/repository/Maven-Hosted/; - default - - - - - - + + nexus + jenkins + admin@123 + From 1c4089c1308e3a74567a7752b441ee9004a5066e Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Mon, 12 Sep 2022 12:02:52 +0530 Subject: [PATCH 11/30] updated --- settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.xml b/settings.xml index a310ec7e50..d6be711309 100644 --- a/settings.xml +++ b/settings.xml @@ -2,4 +2,4 @@ nexus jenkins admin@123 - + From 9cba583cff2b8c4dbd65793fa3e3190270efa9ab Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Mon, 12 Sep 2022 12:06:21 +0530 Subject: [PATCH 12/30] pipeline added --- Jenkinsfile | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fb3607c2b3..603ff5817f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,29 @@ -pipeline { +pipeline{ agent any - stages { - stage('Hello from Branch2') { - steps { - echo "Branch=Test2" + //environment { + // PATH = "$PATH:/opt/apache-maven-3.8.2/bin" + //} + stages{ + stage('GetCode'){ + steps{ + git 'https://github.com/Sharath8000/hello-world.git' + } + } + stage('Build & deploy'){ + steps{ + sh 'mvn clean deploy -X' + } + } + stage('SonarQube analysis') { + // def scannerHome = tool 'SonarScanner 4.0'; + steps{ + withSonarQubeEnv('sonarqube') { + // If you have configured more than one global server connection, you can specify its name + // sh "${scannerHome}/bin/sonar-scanner" + sh "mvn sonar:sonar" + } } } + } } From 825f5dd8bb2c6bf976517eff1ffbdef0270a57f9 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Mon, 12 Sep 2022 12:50:58 +0530 Subject: [PATCH 13/30] updated pom file --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index d6082047f3..47612f677b 100644 --- a/pom.xml +++ b/pom.xml @@ -22,6 +22,7 @@ + // Maven nexus Maven-Hosted From 05fde5e94f020c309d118765acfc633d22ad2bcb Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Mon, 12 Sep 2022 13:09:09 +0530 Subject: [PATCH 14/30] profileaddedinsetting.xml --- settings.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/settings.xml b/settings.xml index d6be711309..64063549be 100644 --- a/settings.xml +++ b/settings.xml @@ -1,3 +1,16 @@ + + + + + nexus + Maven-Hosted + http://34.236.152.13:8081/repository/Maven-Hosted/ + + + + + + nexus jenkins From ba6f913ff22353014b99e2796a8102557b246998 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Mon, 12 Sep 2022 13:13:44 +0530 Subject: [PATCH 15/30] settings file updated --- settings.xml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/settings.xml b/settings.xml index 64063549be..a6e64ce583 100644 --- a/settings.xml +++ b/settings.xml @@ -1,3 +1,10 @@ + + + nexus + jenkins + admin@123 + + @@ -9,10 +16,6 @@ + - - nexus - jenkins - admin@123 - From 244ebafdcff56294c79c329b17f1c507d06a086f Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Mon, 12 Sep 2022 13:19:55 +0530 Subject: [PATCH 16/30] Update settings.xml --- settings.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/settings.xml b/settings.xml index a6e64ce583..1c4ddc6f87 100644 --- a/settings.xml +++ b/settings.xml @@ -1,14 +1,18 @@ - + + nexus jenkins admin@123 + - + nexus Maven-Hosted http://34.236.152.13:8081/repository/Maven-Hosted/ @@ -17,5 +21,3 @@ - - From d85ad81289157ae71db64bc30a08036edd6eac7f Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Mon, 12 Sep 2022 13:26:06 +0530 Subject: [PATCH 17/30] Update pom.xml --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 47612f677b..39fd1751ba 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.example.maven-project maven-project - pom + jar 1.0-SNAPSHOT Maven Project Sample Maven project with a working, deployable site. @@ -22,7 +22,7 @@ - // Maven + nexus Maven-Hosted From 0188fad10cc09c95f85d5b85dc41199378e9e333 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Tue, 13 Sep 2022 12:27:07 +0530 Subject: [PATCH 18/30] agent updated --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 603ff5817f..d0f2a075a1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline{ - agent any + agent slave1 //environment { // PATH = "$PATH:/opt/apache-maven-3.8.2/bin" //} From 94c3f86fc7a80b878145ecec3dcf09cc01178ef8 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Tue, 13 Sep 2022 12:28:59 +0530 Subject: [PATCH 19/30] agent added --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d0f2a075a1..fe4fbe3ee0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline{ - agent slave1 + agent {label 'slave1'} //environment { // PATH = "$PATH:/opt/apache-maven-3.8.2/bin" //} From b5f33f89aafe31b503da69f71f67d8cea36bfa58 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Tue, 13 Sep 2022 13:20:47 +0530 Subject: [PATCH 20/30] Update Dockerfile --- Dockerfile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 171c9407fb..6e8acef6ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,2 @@ -# Pull base image -From tomcat:8-jre8 - -# Maintainer -MAINTAINER "valaxytech@gmail.com" -COPY ./webapp.war /usr/local/tomcat/webapps - +FROM nginx:alpine +COPY . /usr/share/nginx/html From ab14ca36daf344595601317a7285a828bc0e4348 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Tue, 13 Sep 2022 13:21:16 +0530 Subject: [PATCH 21/30] updated docker file --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6e8acef6ae..d1220a5c1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,2 @@ FROM nginx:alpine -COPY . /usr/share/nginx/html +COPY ./index.html /usr/share/nginx/html From 847dc1d6f5b512a6418d3494a1c35935250ea68b Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Tue, 13 Sep 2022 13:26:03 +0530 Subject: [PATCH 22/30] Docker build stage added --- Jenkinsfile | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fe4fbe3ee0..fd8436255a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,21 +9,10 @@ pipeline{ git 'https://github.com/Sharath8000/hello-world.git' } } - stage('Build & deploy'){ - steps{ - sh 'mvn clean deploy -X' - } + stage('Docker image build){ + steps { + sh 'docker build -t firstsapp .' + } } - stage('SonarQube analysis') { - // def scannerHome = tool 'SonarScanner 4.0'; - steps{ - withSonarQubeEnv('sonarqube') { - // If you have configured more than one global server connection, you can specify its name - // sh "${scannerHome}/bin/sonar-scanner" - sh "mvn sonar:sonar" - } - } - } - } } From 7d5337854aa6fc1c3ad97012b0d74d23888a0dc5 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Tue, 13 Sep 2022 13:26:54 +0530 Subject: [PATCH 23/30] index.html file created --- index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 0000000000..f826c1b7bb --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +Welcome my first app From a141810b080a79050051b43193e3f8d54c521f0f Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Tue, 13 Sep 2022 13:31:28 +0530 Subject: [PATCH 24/30] added ' --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fd8436255a..e264220fe0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline{ git 'https://github.com/Sharath8000/hello-world.git' } } - stage('Docker image build){ + stage('Docker image build'){ steps { sh 'docker build -t firstsapp .' } From 005ba3c640f55a80c3194b71227ea359d0609e9a Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Tue, 13 Sep 2022 13:36:51 +0530 Subject: [PATCH 25/30] Update Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index d1220a5c1b..da03e99180 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,3 @@ +// pull base image FROM nginx:alpine COPY ./index.html /usr/share/nginx/html From 7ca805810f91f9493916c3aeb4e6898728fa787b Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Tue, 13 Sep 2022 13:43:51 +0530 Subject: [PATCH 26/30] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index da03e99180..ffacf32b9c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,3 @@ -// pull base image + FROM nginx:alpine COPY ./index.html /usr/share/nginx/html From dcd1baca159d0b240c9a4846d013d74c871d0a78 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Wed, 14 Sep 2022 18:12:30 +0530 Subject: [PATCH 27/30] Update pom.xml --- pom.xml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 39fd1751ba..95826a3f37 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.example.maven-project maven-project - jar + pom 1.0-SNAPSHOT Maven Project Sample Maven project with a working, deployable site. @@ -22,18 +22,16 @@ - - - nexus - Maven-Hosted - http://34.236.152.13:8081/repository/Maven-Hosted/ - - - site-server - Test Project Site - file:///tmp/maven-project-site - - + + nexus + http://34.226.202.185:8081/repository/snapshots/ + + + nexus + http://34.226.202.185:8081/repository/releases/ + + + @@ -181,6 +179,11 @@ jsp-api 2.2 + + com.vikas.apps + firstapp + 1.0.0 + junit From ab16321a2e6d71510a7e22ebfb9308a4f81834f0 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Wed, 14 Sep 2022 18:13:12 +0530 Subject: [PATCH 28/30] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e264220fe0..b268659594 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline{ } stage('Docker image build'){ steps { - sh 'docker build -t firstsapp .' + sh 'mvn clean deploy' } } } From 650c0c145631eae6f6cd77a3b5614aaac5872a70 Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Wed, 14 Sep 2022 18:22:38 +0530 Subject: [PATCH 29/30] pom added --- pom.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 95826a3f37..5c232a0a8f 100644 --- a/pom.xml +++ b/pom.xml @@ -180,10 +180,11 @@ 2.2 - com.vikas.apps - firstapp - 1.0.0 - + com.vikas.apps + firstapp + 1.0.0 + war + junit From e3119654ca6a8b9191dbd02b29bea6ffca27851a Mon Sep 17 00:00:00 2001 From: Sharath8000 <64590760+Sharath8000@users.noreply.github.com> Date: Wed, 14 Sep 2022 18:36:00 +0530 Subject: [PATCH 30/30] sonar stage added --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index b268659594..99dfebf158 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,5 +14,15 @@ pipeline{ sh 'mvn clean deploy' } } + stage('SonarQube analysis') { + // def scannerHome = tool 'SonarScanner 4.0'; + steps{ + withSonarQubeEnv('sonarqube') { + // If you have configured more than one global server connection, you can specify its name + // sh "${scannerHome}/bin/sonar-scanner" + sh "mvn sonar:sonar" + } + } + } } }