From 55d43c1d4943b91cf808d4e896aac7eda0c06c59 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Wed, 8 Dec 2021 16:32:19 +0530 Subject: [PATCH 01/34] Dockerfile change --- Dockerfile | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7c7a276ec..ca317de24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,5 @@ -FROM gradle:jdk-alpine - -WORKDIR /home/gradle/project - -EXPOSE 8080 - -USER root - -RUN apk update - -ENV GRADLE_USER_HOME /home/gradle/project - -COPY . /home/gradle/project - -RUN ./gradlew build - - FROM java:jre-alpine - WORKDIR /home/gradle/project - -COPY --from=0 /home/gradle/project/build/libs/project-0.0.1-SNAPSHOT.jar . - +COPY --from=0 build/libs/*.jar . ENTRYPOINT java -jar project-0.0.1-SNAPSHOT.jar +# From d17082da27bd074f2cf110ba1d9492d339a532e1 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Wed, 8 Dec 2021 16:36:25 +0530 Subject: [PATCH 02/34] updated the dockerfile --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ca317de24..6b1282107 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ FROM java:jre-alpine WORKDIR /home/gradle/project COPY --from=0 build/libs/*.jar . -ENTRYPOINT java -jar project-0.0.1-SNAPSHOT.jar -# +ENTRYPOINT java -jar project-0.0.1-SNAPSHOT.jarcommit From a6faadce1757e020e3ae15eb0afefe0f41335710 Mon Sep 17 00:00:00 2001 From: bharu459 <89682206+bharu459@users.noreply.github.com> Date: Wed, 8 Dec 2021 21:37:14 +0530 Subject: [PATCH 03/34] Create sonar-project.properties --- sonar-project.properties | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..6a87f736b --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,14 @@ +# must be unique in a given SonarQube instance +sonar.projectKey=spring_boot_app +# --- optional properties --- +# defaults to project key +sonar.projectName=spring_boot_app +# defaults to 'not provided' +sonar.projectVersion=1.0 +# Path is relative to the sonar-project.properties file. Defaults to . +sonar.sources=. +# Encoding of the source code. Default is default system encoding +sonar.sourceEncoding=UTF-8 +sonar.host.url=http://c653ea429b1c.mylabserver.com:8066 +sonar.java.binaries=./target/classes +sonar.login=95ab9f7e676fff080cf3f34a4e1becdf93862add From b0932aa688788ddd205819004a5f76b6f5a11522 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Wed, 8 Dec 2021 21:50:00 +0530 Subject: [PATCH 04/34] sonar file --- sonar-project.properties | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..e69de29bb From 54adb87f3c52a48e4ecd5ee4ad74dcc4b6cbfab2 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Thu, 9 Dec 2021 05:30:27 +0530 Subject: [PATCH 05/34] sonar file --- .gitignore | 4 ++-- Dockerfile | 2 +- sonar-project.properties | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 3deb36623..505977d3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .gradle -/build/ +#/build/ !gradle/wrapper/gradle-wrapper.jar *.db @@ -19,7 +19,7 @@ ### NetBeans ### nbproject/private/ -build/ +#build/ nbbuild/ dist/ nbdist/ diff --git a/Dockerfile b/Dockerfile index 6b1282107..f282c7097 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ FROM java:jre-alpine WORKDIR /home/gradle/project -COPY --from=0 build/libs/*.jar . +COPY build/libs/*.jar . ENTRYPOINT java -jar project-0.0.1-SNAPSHOT.jarcommit diff --git a/sonar-project.properties b/sonar-project.properties index 6a87f736b..c790ab127 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,4 +11,4 @@ sonar.sources=. sonar.sourceEncoding=UTF-8 sonar.host.url=http://c653ea429b1c.mylabserver.com:8066 sonar.java.binaries=./target/classes -sonar.login=95ab9f7e676fff080cf3f34a4e1becdf93862add +sonar.login=b4104256ec9d309dcff5bf5d1ea8bf904feed643 From 3aeb7a245d446f71bba1d7ca8ac7f0a55f8cf9fa Mon Sep 17 00:00:00 2001 From: bharu459 <89682206+bharu459@users.noreply.github.com> Date: Thu, 9 Dec 2021 06:04:00 +0530 Subject: [PATCH 06/34] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index c790ab127..0550b1058 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,6 +9,6 @@ sonar.projectVersion=1.0 sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 -sonar.host.url=http://c653ea429b1c.mylabserver.com:8066 +sonar.host.url=http://c653ea429b1d.mylabserver.com:8066 sonar.java.binaries=./target/classes sonar.login=b4104256ec9d309dcff5bf5d1ea8bf904feed643 From f7e7104692b3d0cb55076c31a5f688413624607a Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Thu, 9 Dec 2021 11:16:52 +0530 Subject: [PATCH 07/34] adding jenkins file --- Jenkinsfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..e69de29bb From 0adb6da95b5414dfe74e777a67b48d2e99d41c0f Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Fri, 10 Dec 2021 15:30:16 +0530 Subject: [PATCH 08/34] commited new changes --- Jenkinsfile | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index e69de29bb..5527b7efc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -0,0 +1,100 @@ +pipeline{ + agent any + stages{ + stage("sc checkout"){ + steps{ + script{ + git branch: "qa", url: "https://github.com/bharu459/spring-boot-realworld-example-app.git" + + } + } + } + stage("build analysis"){ + steps{ + script{ + sh " ./gradlew build " + } + } + } + stage("source code analysis"){ + steps{ + script{ + sh "ls -lrt" + //sh" sonar-scanner --version" + //sh "/sonar/bin/sonar-scanner" + + } + } + } + stage("build image"){ + steps{ + script{ + sh "ls -lrt" + sh "cat Dockerfile" + sh "docker build -t bharathi15/springbootimage:${BUILD_NUMBER} ." + } + } + } + stage("push image to docker registry"){ + steps{ + script{ + + sh """ docker login --username bharathi15 + docker push bharathi15/spring-boot-image:${BUILD_NUMBER} .""" + } + + + } + } + } +} +pipeline{ + agent any + stages{ + stage("sc checkout"){ + steps{ + script{ + git branch: "qa", url: "https://github.com/bharu459/spring-boot-realworld-example-app.git" + + } + } + } + stage("build analysis"){ + steps{ + script{ + sh " ./gradlew build " + } + } + } + stage("source code analysis"){ + steps{ + script{ + sh "ls -lrt" + //sh" sonar-scanner --version" + //sh "/sonar/bin/sonar-scanner" + + } + } + } + stage("build image"){ + steps{ + script{ + sh "ls -lrt" + sh "cat Dockerfile" + sh "docker build -t bharathi15/springbootimage:${BUILD_NUMBER} ." + } + } + } + stage("push image to docker registry"){ + steps{ + script{ + + sh """ docker login --username bharathi15 + docker push bharathi15/spring-boot-image:${BUILD_NUMBER} .""" + } + + + } + } + } +} From 2c5190c49df18f9d3754873fb42e1df9d37e7226 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Mon, 13 Dec 2021 19:00:48 +0530 Subject: [PATCH 09/34] sonar token change --- Jenkinsfile | 105 ++++++++++++++++++++------------------- sonar-project.properties | 2 +- 2 files changed, 55 insertions(+), 52 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5527b7efc..5ae3862a0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,9 +19,10 @@ pipeline{ stage("source code analysis"){ steps{ script{ - sh "ls -lrt" - //sh" sonar-scanner --version" - //sh "/sonar/bin/sonar-scanner" + sh """ + ls -lrt + /home/cloud_user/sonar/bin/sonar-scanner + """ } } @@ -31,7 +32,7 @@ pipeline{ script{ sh "ls -lrt" sh "cat Dockerfile" - sh "docker build -t bharathi15/springbootimage:${BUILD_NUMBER} ." + sh " sudo docker build -t bharathi15/springbootimage:${BUILD_NUMBER} ." } } } @@ -39,8 +40,8 @@ pipeline{ steps{ script{ - sh """ docker login --username bharathi15 - docker push bharathi15/spring-boot-image:${BUILD_NUMBER} .""" + sh """ sudo docker login --username bharathi15 + sudo docker push bharathi15/spring-boot-image:${BUILD_NUMBER} .""" } @@ -48,53 +49,55 @@ pipeline{ } } } -pipeline{ - agent any - stages{ - stage("sc checkout"){ - steps{ - script{ - git branch: "qa", url: "https://github.com/bharu459/spring-boot-realworld-example-app.git" +// pipeline{ +// agent any +// stages{ +// stage("sc checkout"){ +// steps{ +// script{ +// git branch: "qa", url: "https://github.com/bharu459/spring-boot-realworld-example-app.git" - } - } - } - stage("build analysis"){ - steps{ - script{ - sh " ./gradlew build " - } - } - } - stage("source code analysis"){ - steps{ - script{ - sh "ls -lrt" - //sh" sonar-scanner --version" - //sh "/sonar/bin/sonar-scanner" +// } +// } +// } +// stage("build analysis"){ +// steps{ +// script{ +// sh " ./gradlew build " +// } +// } +// } +// stage("source code analysis"){ +// steps{ +// script{ +// sh "ls -lrt" +// sh" sonar-scanner --version" +// sh "ls -lrt" +// sh " cd spring-boot-realworld-example-app" +// sh "sudo /sonar/bin/sonar/bin/sonar-scanner" - } - } - } - stage("build image"){ - steps{ - script{ - sh "ls -lrt" - sh "cat Dockerfile" - sh "docker build -t bharathi15/springbootimage:${BUILD_NUMBER} ." - } - } - } - stage("push image to docker registry"){ - steps{ - script{ +// } +// } +// } +// stage("build image"){ +// steps{ +// script{ +// sh "ls -lrt" +// sh "cat Dockerfile" +// sh " sudo docker build -t bharathi15/springbootimage:${BUILD_NUMBER} ." +// } +// } +// } +// stage("push image to docker registry"){ +// steps{ +// script{ - sh """ docker login --username bharathi15 - docker push bharathi15/spring-boot-image:${BUILD_NUMBER} .""" - } +// sh """ sudo docker login --username bharathi15 +// sudo docker push bharathi15/spring-boot-image:${BUILD_NUMBER} .""" +// } - } - } - } -} +// } +// } +// } +// } diff --git a/sonar-project.properties b/sonar-project.properties index 0550b1058..c80373ab0 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,4 +11,4 @@ sonar.sources=. sonar.sourceEncoding=UTF-8 sonar.host.url=http://c653ea429b1d.mylabserver.com:8066 sonar.java.binaries=./target/classes -sonar.login=b4104256ec9d309dcff5bf5d1ea8bf904feed643 +sonar.login=3966ecd29e517182567b0bd7af54cd75307ea217 From 02b3972aa87cff3e8f8bf356713b57c1a73a8319 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Mon, 13 Dec 2021 19:05:44 +0530 Subject: [PATCH 10/34] new token passage --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index c80373ab0..39ae5a2da 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,4 +11,4 @@ sonar.sources=. sonar.sourceEncoding=UTF-8 sonar.host.url=http://c653ea429b1d.mylabserver.com:8066 sonar.java.binaries=./target/classes -sonar.login=3966ecd29e517182567b0bd7af54cd75307ea217 +sonar.login=15c5c852a1605bc33b56601ef153d6ae6dabd3ca From 44d803883bc8f24b1142c67c7fb20819bbfae5f6 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Mon, 13 Dec 2021 19:13:34 +0530 Subject: [PATCH 11/34] new token --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 39ae5a2da..b6a80ce9d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,4 +11,4 @@ sonar.sources=. sonar.sourceEncoding=UTF-8 sonar.host.url=http://c653ea429b1d.mylabserver.com:8066 sonar.java.binaries=./target/classes -sonar.login=15c5c852a1605bc33b56601ef153d6ae6dabd3ca +sonar.login=2199de0fe32ace577fa8128b18fb3c7c8567686f From c91e4dad4388a07e3ae2619f37deec0b1aaed8c2 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Mon, 13 Dec 2021 19:31:20 +0530 Subject: [PATCH 12/34] pvt url --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index b6a80ce9d..e27101c83 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,6 +9,6 @@ sonar.projectVersion=1.0 sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 -sonar.host.url=http://c653ea429b1d.mylabserver.com:8066 +sonar.host.url=http://172.31.35.188.com:8066 sonar.java.binaries=./target/classes sonar.login=2199de0fe32ace577fa8128b18fb3c7c8567686f From 7dd85990ca6baaa4e46e5e2fdb7ca8d0cebed7f0 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Mon, 13 Dec 2021 19:39:13 +0530 Subject: [PATCH 13/34] new / --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index e27101c83..b838cbceb 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,6 +9,6 @@ sonar.projectVersion=1.0 sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 -sonar.host.url=http://172.31.35.188.com:8066 +sonar.host.url=http://172.31.35.188.com:8066/ sonar.java.binaries=./target/classes sonar.login=2199de0fe32ace577fa8128b18fb3c7c8567686f From ab757c29e439cbe0dac4546f70be9c4ab667aef6 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Tue, 14 Dec 2021 06:25:01 +0530 Subject: [PATCH 14/34] new token --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index b838cbceb..2b3828e1f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,4 +11,4 @@ sonar.sources=. sonar.sourceEncoding=UTF-8 sonar.host.url=http://172.31.35.188.com:8066/ sonar.java.binaries=./target/classes -sonar.login=2199de0fe32ace577fa8128b18fb3c7c8567686f +sonar.login=3af049ddc0c4cf58cfa7ae1a208d48f6d731eccf From 648dd4e49cbec68f11e4a1923ca20058c29e52eb Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Tue, 14 Dec 2021 12:24:04 +0530 Subject: [PATCH 15/34] sonar anlaysis new token --- Jenkinsfile | 88 ++++++++-------------------------------- sonar-project.properties | 2 +- 2 files changed, 19 insertions(+), 71 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5ae3862a0..3e50df361 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,22 +16,22 @@ pipeline{ } } } - stage("source code analysis"){ - steps{ - script{ - sh """ - ls -lrt - /home/cloud_user/sonar/bin/sonar-scanner - """ + // stage("source code analysis"){ + // steps{ + // script{ + // sh """ + + // home/cloud_user/sonar/bin/sonar-scanner + // """ - } - } - } + // } + //} + // } stage("build image"){ steps{ script{ - sh "ls -lrt" - sh "cat Dockerfile" + + sh " sudo docker build -t bharathi15/springbootimage:${BUILD_NUMBER} ." } } @@ -39,65 +39,13 @@ pipeline{ stage("push image to docker registry"){ steps{ script{ - - sh """ sudo docker login --username bharathi15 - sudo docker push bharathi15/spring-boot-image:${BUILD_NUMBER} .""" - } - - + sh """ + sudo docker tag bharathi15/spring-boot-image:${BUILD_NUMBER} bharathi15/spring-boot-image:${BUILD_NUMBER} + sudo docker login + sudo docker push bharathi15/spring-boot-image:${BUILD_NUMBER} """ + } } + } } } -// pipeline{ -// agent any -// stages{ -// stage("sc checkout"){ -// steps{ -// script{ -// git branch: "qa", url: "https://github.com/bharu459/spring-boot-realworld-example-app.git" - -// } -// } -// } -// stage("build analysis"){ -// steps{ -// script{ -// sh " ./gradlew build " -// } -// } -// } -// stage("source code analysis"){ -// steps{ -// script{ -// sh "ls -lrt" -// sh" sonar-scanner --version" -// sh "ls -lrt" -// sh " cd spring-boot-realworld-example-app" -// sh "sudo /sonar/bin/sonar/bin/sonar-scanner" - -// } -// } -// } -// stage("build image"){ -// steps{ -// script{ -// sh "ls -lrt" -// sh "cat Dockerfile" -// sh " sudo docker build -t bharathi15/springbootimage:${BUILD_NUMBER} ." -// } -// } -// } -// stage("push image to docker registry"){ -// steps{ -// script{ - -// sh """ sudo docker login --username bharathi15 -// sudo docker push bharathi15/spring-boot-image:${BUILD_NUMBER} .""" -// } - - -// } -// } -// } -// } diff --git a/sonar-project.properties b/sonar-project.properties index 2b3828e1f..2d3792255 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,4 +11,4 @@ sonar.sources=. sonar.sourceEncoding=UTF-8 sonar.host.url=http://172.31.35.188.com:8066/ sonar.java.binaries=./target/classes -sonar.login=3af049ddc0c4cf58cfa7ae1a208d48f6d731eccf +sonar.login=35906e0e8baf7ec6d7befab18738d3787b235167 From de7fa1e526bde875205d88d0231df2e80007e691 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Tue, 14 Dec 2021 13:45:09 +0530 Subject: [PATCH 16/34] after build only --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 2d3792255..7c374ec75 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -10,5 +10,5 @@ sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 sonar.host.url=http://172.31.35.188.com:8066/ -sonar.java.binaries=./target/classes +sonar.java.binaries=./build/libs sonar.login=35906e0e8baf7ec6d7befab18738d3787b235167 From 4698ea9b7c7a8396022fe6b047af29d576ada391 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Tue, 14 Dec 2021 13:54:09 +0530 Subject: [PATCH 17/34] msg --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 7c374ec75..2d3792255 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -10,5 +10,5 @@ sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 sonar.host.url=http://172.31.35.188.com:8066/ -sonar.java.binaries=./build/libs +sonar.java.binaries=./target/classes sonar.login=35906e0e8baf7ec6d7befab18738d3787b235167 From eab89b1210958b6af5837082b604f404897ee24b Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Tue, 14 Dec 2021 14:28:01 +0530 Subject: [PATCH 18/34] sony --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 2d3792255..08079dfc3 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,4 +11,4 @@ sonar.sources=. sonar.sourceEncoding=UTF-8 sonar.host.url=http://172.31.35.188.com:8066/ sonar.java.binaries=./target/classes -sonar.login=35906e0e8baf7ec6d7befab18738d3787b235167 +sonar.login=c44db8803272c5310a167fd6271efc6498444270 From f2a2b47e78d25d454765f9c5cf64610eb8c146ff Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Tue, 14 Dec 2021 14:33:44 +0530 Subject: [PATCH 19/34] msg --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 08079dfc3..de5e3a067 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -10,5 +10,5 @@ sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 sonar.host.url=http://172.31.35.188.com:8066/ -sonar.java.binaries=./target/classes +sonar.java.binaries=.build/libs sonar.login=c44db8803272c5310a167fd6271efc6498444270 From 3bce770a6b212eb4c4ba5b1f0dd9f06fee1ef4c3 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Tue, 14 Dec 2021 14:35:02 +0530 Subject: [PATCH 20/34] msg2 --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index de5e3a067..a569c102d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -10,5 +10,5 @@ sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 sonar.host.url=http://172.31.35.188.com:8066/ -sonar.java.binaries=.build/libs +sonar.java.binaries=./build/libs sonar.login=c44db8803272c5310a167fd6271efc6498444270 From 20e1ad164d8c66bd710ecc52f8d9e3c5b25d40f0 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Tue, 14 Dec 2021 14:41:40 +0530 Subject: [PATCH 21/34] msg --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index a569c102d..375254886 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -10,5 +10,5 @@ sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 sonar.host.url=http://172.31.35.188.com:8066/ -sonar.java.binaries=./build/libs +sonar.java.binaries=/src/main sonar.login=c44db8803272c5310a167fd6271efc6498444270 From 79e3e0808522e408ed753e12148751afe9b3fa1a Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Tue, 14 Dec 2021 14:47:00 +0530 Subject: [PATCH 22/34] msg 2 --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 375254886..cca4d239e 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -10,5 +10,5 @@ sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 sonar.host.url=http://172.31.35.188.com:8066/ -sonar.java.binaries=/src/main +sonar.binaries=/src/main/ sonar.login=c44db8803272c5310a167fd6271efc6498444270 From d922fa2f1a360ffe367e58c0db5113773a61bac9 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Wed, 15 Dec 2021 12:32:13 +0530 Subject: [PATCH 23/34] msg --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index cca4d239e..09183a020 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,6 +9,6 @@ sonar.projectVersion=1.0 sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 -sonar.host.url=http://172.31.35.188.com:8066/ +sonar.host.url=http://172.31.35.188.com:8066 sonar.binaries=/src/main/ -sonar.login=c44db8803272c5310a167fd6271efc6498444270 +sonar.login=93bf045a0cdd89759efd305011d2fc303ab705f5 From f9154d32cba4f11fface59328235a339ace70344 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Wed, 15 Dec 2021 12:48:24 +0530 Subject: [PATCH 24/34] new url --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 09183a020..839ba14da 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,6 +9,6 @@ sonar.projectVersion=1.0 sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 -sonar.host.url=http://172.31.35.188.com:8066 +sonar.host.url=http://c653ea429b1c.mylabserver.com:8066/ sonar.binaries=/src/main/ sonar.login=93bf045a0cdd89759efd305011d2fc303ab705f5 From 86be95598922de6e91a62763670dce7a6e606f51 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Wed, 15 Dec 2021 17:36:03 +0530 Subject: [PATCH 25/34] msg --- Jenkinsfile | 38 +++++++++++++++++++++++++------------- sonar-project.properties | 4 ++-- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3e50df361..af9a83d7f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,12 @@ pipeline{ + environment { + + registry = "bharathi15/https://hub.docker.com/repositories" + + registryCredential = 'Bharathi_Docker_ID' + + } + agent any stages{ stage("sc checkout"){ @@ -16,33 +24,37 @@ pipeline{ } } } - // stage("source code analysis"){ - // steps{ - // script{ - // sh """ + stage("source code analysis"){ + steps{ + script{ + sh """ - // home/cloud_user/sonar/bin/sonar-scanner - // """ + home/cloud_user/sonar/bin/sonar-scanner + """ - // } - //} - // } + } + } + } stage("build image"){ steps{ script{ - sh " sudo docker build -t bharathi15/springbootimage:${BUILD_NUMBER} ." + sh " sudo docker build -t bharathi15/spring-boot-image:latest ." } } } stage("push image to docker registry"){ steps{ script{ - sh """ - sudo docker tag bharathi15/spring-boot-image:${BUILD_NUMBER} bharathi15/spring-boot-image:${BUILD_NUMBER} - sudo docker login + + withDockerRegistry(credentialsId: 'Bharathi_Docker_ID', url: 'https://hub.docker.com/u/bharathi15') { + + + sh """ sudo docker tag bharathi15/spring-boot-image:latest bharathi15/spring-boot-image:${BUILD_NUMBER} + sudo docker push bharathi15/spring-boot-image:${BUILD_NUMBER} """ + } } } diff --git a/sonar-project.properties b/sonar-project.properties index 839ba14da..dd25d494f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,6 +9,6 @@ sonar.projectVersion=1.0 sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 -sonar.host.url=http://c653ea429b1c.mylabserver.com:8066/ +sonar.host.url=http://c653ea429b1c.mylabserver.com:8066 sonar.binaries=/src/main/ -sonar.login=93bf045a0cdd89759efd305011d2fc303ab705f5 +sonar.login=74e917f556d327e716d056a9259c418a528bbd57 From 95eafdf76120b6c27cec9fb090e12b862be4554f Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Wed, 15 Dec 2021 18:29:11 +0530 Subject: [PATCH 26/34] new file --- sonar-project.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index dd25d494f..3a5e2b0bd 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,8 +1,8 @@ # must be unique in a given SonarQube instance -sonar.projectKey=spring_boot_app +sonar.projectKey=spring_real-world-app # --- optional properties --- # defaults to project key -sonar.projectName=spring_boot_app +sonar.projectName=spring_real-world-app # defaults to 'not provided' sonar.projectVersion=1.0 # Path is relative to the sonar-project.properties file. Defaults to . @@ -10,5 +10,5 @@ sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 sonar.host.url=http://c653ea429b1c.mylabserver.com:8066 -sonar.binaries=/src/main/ +sonar.java.binaries=./build/libs sonar.login=74e917f556d327e716d056a9259c418a528bbd57 From 43b6d654056a0374845fd818ff3e7f59391b548c Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Wed, 15 Dec 2021 22:54:35 +0530 Subject: [PATCH 27/34] jenkin file with build sonar analysis docker image push code --- Jenkinsfile | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index af9a83d7f..1ccf1ba6c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ pipeline{ script{ sh """ - home/cloud_user/sonar/bin/sonar-scanner + /home/cloud_user/sonar/bin/sonar-scanner """ } @@ -48,16 +48,14 @@ pipeline{ steps{ script{ - withDockerRegistry(credentialsId: 'Bharathi_Docker_ID', url: 'https://hub.docker.com/u/bharathi15') { - - - sh """ sudo docker tag bharathi15/spring-boot-image:latest bharathi15/spring-boot-image:${BUILD_NUMBER} - - sudo docker push bharathi15/spring-boot-image:${BUILD_NUMBER} """ - } - } + withCredentials([string(credentialsId: 'bharathi15', variable: 'Dockerhubpwd')]) { + sh """ sudo docker login -u bharathi15 -p ${Dockerhubpwd} + sudo docker tag bharathi15/spring-boot-image:latest bharathi15/spring-boot-image:${BUILD_NUMBER} + sudo docker push bharathi15/spring-boot-image:${BUILD_NUMBER} """ + + } + } } - } } -} +} \ No newline at end of file From 808445224fd40115eaf1ba72ace5ac90fb049106 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Thu, 16 Dec 2021 09:10:08 +0530 Subject: [PATCH 28/34] token change --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 3a5e2b0bd..64a31a08d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,4 +11,4 @@ sonar.sources=. sonar.sourceEncoding=UTF-8 sonar.host.url=http://c653ea429b1c.mylabserver.com:8066 sonar.java.binaries=./build/libs -sonar.login=74e917f556d327e716d056a9259c418a528bbd57 +sonar.login=d894764e5c4183f535fba6a4becea6a7201a3805 From 6f30640e48787e6e7337c6b2fde6bdddf930bc82 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Fri, 24 Dec 2021 20:08:17 +0530 Subject: [PATCH 29/34] new sonar file --- Jenkinsfile | 60 ++++++++++++++++++++-------------------- sonar-project.properties | 4 +-- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1ccf1ba6c..c8f66e34b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,22 +1,17 @@ pipeline{ - environment { - - registry = "bharathi15/https://hub.docker.com/repositories" - - registryCredential = 'Bharathi_Docker_ID' - - } - - agent any - stages{ - stage("sc checkout"){ - steps{ + environment { + registry = "bharathi15/https://hub.docker.com/repositories" + registryCredential = 'Bharathi_Docker_ID' + } + agent any + stages{ + stage("sc checkout"){ + steps{ script{ git branch: "qa", url: "https://github.com/bharu459/spring-boot-realworld-example-app.git" - } - } - } + } + } stage("build analysis"){ steps{ script{ @@ -26,34 +21,39 @@ pipeline{ } stage("source code analysis"){ steps{ - script{ - sh """ - - /home/cloud_user/sonar/bin/sonar-scanner - """ + script{ + sh " /home/cloud_user/sonar/bin/sonar-scanner " } } - } + } stage("build image"){ steps{ script{ - - - sh " sudo docker build -t bharathi15/spring-boot-image:latest ." + sh " sudo docker build -t bharathi15/spring-boot-image:latest ." } } } stage("push image to docker registry"){ steps{ script{ - - withCredentials([string(credentialsId: 'bharathi15', variable: 'Dockerhubpwd')]) { - sh """ sudo docker login -u bharathi15 -p ${Dockerhubpwd} - sudo docker tag bharathi15/spring-boot-image:latest bharathi15/spring-boot-image:${BUILD_NUMBER} - sudo docker push bharathi15/spring-boot-image:${BUILD_NUMBER} """ + withCredentials([string(credentialsId: 'bharathi15', variable: 'Dockerhubpwd')]) { + sh """ sudo docker login -u bharathi15 -p ${Dockerhubpwd} + sudo docker tag bharathi15/spring-boot-image:latest bharathi15/spring-boot-image:${BUILD_NUMBER} + sudo docker push bharathi15/spring-boot-image:${BUILD_NUMBER} """ - } + } + } + } + } + stage("push artifact to JFROG repository"){ + steps{ + script{ + withCredentials([string(credentialsId: 'Jenkins_artifactory', variable: 'Artifactory_ID')]) { + + sh """ curl -H "X-JFrog-Art-Api:AKCp8k93MErqCS561VGxQP3ydJsrikm5oeysb5BVzgqcHidVHHva2kqDU7qRkf3EbqLrX7CLj" -T /home/cloud_user/new/spring-boot-realworld-example-app/build/libs/spring-boot-realworld-example-app-0.0.1-SNAPSHOT.jar http://c653ea429b1c.mylabserver.com:8081/artifactory/example-repo-local/spring-boot-realworld-example-app-0.0.1-SNAPSHOT:${BUILD_NUMBER}.jar """ + } + } } } diff --git a/sonar-project.properties b/sonar-project.properties index 64a31a08d..09c2c9971 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,4 +1,4 @@ -# must be unique in a given SonarQube instance +d37d66acd3cd88493787e76d03ebc030ddb3d04e# must be unique in a given SonarQube instance sonar.projectKey=spring_real-world-app # --- optional properties --- # defaults to project key @@ -9,6 +9,6 @@ sonar.projectVersion=1.0 sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 -sonar.host.url=http://c653ea429b1c.mylabserver.com:8066 +sonar.host.url=http://c653ea429b1d.mylabserver.com:8066 sonar.java.binaries=./build/libs sonar.login=d894764e5c4183f535fba6a4becea6a7201a3805 From ab8b37f8607037f60e79ea463af302b45f4515d0 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Fri, 24 Dec 2021 20:11:46 +0530 Subject: [PATCH 30/34] new sonar file --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 09c2c9971..1f783a8c9 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,8 +1,8 @@ d37d66acd3cd88493787e76d03ebc030ddb3d04e# must be unique in a given SonarQube instance -sonar.projectKey=spring_real-world-app +sonar.projectKey=spring_real-world-appfrom_secondpipeline # --- optional properties --- # defaults to project key -sonar.projectName=spring_real-world-app +sonar.projectName=spring_real-world-appfrom_secondpipeline # defaults to 'not provided' sonar.projectVersion=1.0 # Path is relative to the sonar-project.properties file. Defaults to . From b777119d907b8cf4d546cd9f5dc560da39be8035 Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Fri, 24 Dec 2021 20:14:12 +0530 Subject: [PATCH 31/34] new sonarfile --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 1f783a8c9..e625be949 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,6 +9,6 @@ sonar.projectVersion=1.0 sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 -sonar.host.url=http://c653ea429b1d.mylabserver.com:8066 +sonar.host.url=http://c653ea429b1c.mylabserver.com:8066 sonar.java.binaries=./build/libs sonar.login=d894764e5c4183f535fba6a4becea6a7201a3805 From 6f5c5aaf6c768868da1cbe1f8b97d20d03abf502 Mon Sep 17 00:00:00 2001 From: bharu459 <89682206+bharu459@users.noreply.github.com> Date: Sat, 25 Dec 2021 12:14:43 +0530 Subject: [PATCH 32/34] Update sonar-project.properties --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index e625be949..671e2fcde 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,6 +9,6 @@ sonar.projectVersion=1.0 sonar.sources=. # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 -sonar.host.url=http://c653ea429b1c.mylabserver.com:8066 +#sonar.host.url=http://c653ea429b1c.mylabserver.com:8066 sonar.java.binaries=./build/libs -sonar.login=d894764e5c4183f535fba6a4becea6a7201a3805 +#sonar.login=d894764e5c4183f535fba6a4becea6a7201a3805 From 002afa089adde8e2320791977f0eadf924ae743d Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Mon, 27 Dec 2021 21:16:47 +0530 Subject: [PATCH 33/34] Deploymentfiles --- deploy/k8s/app-service.yaml | 0 deploy/k8s/db-service.yaml | 0 deploy/k8s/deploy-app.yaml | 0 deploy/k8s/deploy-db.yaml | 0 deploy/playbooks/deploy-app.yaml | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 deploy/k8s/app-service.yaml create mode 100644 deploy/k8s/db-service.yaml create mode 100644 deploy/k8s/deploy-app.yaml create mode 100644 deploy/k8s/deploy-db.yaml create mode 100644 deploy/playbooks/deploy-app.yaml diff --git a/deploy/k8s/app-service.yaml b/deploy/k8s/app-service.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/deploy/k8s/db-service.yaml b/deploy/k8s/db-service.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/deploy/k8s/deploy-app.yaml b/deploy/k8s/deploy-app.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/deploy/k8s/deploy-db.yaml b/deploy/k8s/deploy-db.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/deploy/playbooks/deploy-app.yaml b/deploy/playbooks/deploy-app.yaml new file mode 100644 index 000000000..e69de29bb From 68c12a8ede339311b8ea50222308bdd048104f6a Mon Sep 17 00:00:00 2001 From: Bhararthi Kondabattula Date: Tue, 28 Dec 2021 07:24:52 +0530 Subject: [PATCH 34/34] db deployment file --- deploy/k8s/deploy-app.yaml | 25 +++++++++++++++++++++++++ deploy/k8s/deploy-db.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/deploy/k8s/deploy-app.yaml b/deploy/k8s/deploy-app.yaml index e69de29bb..5ef00a977 100644 --- a/deploy/k8s/deploy-app.yaml +++ b/deploy/k8s/deploy-app.yaml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: spring-boot-Deployment-file + labels: + name: spring-boot-app-deploy + app: spring-boot-Deployment +spec: + template: + metadata: + name: spring-boot-app-pod + labels: + name: spring-boot-app-pod + app: spring-boot-app + spec: + containers: + - name: spring-boot + image: bharathi15/spring-boot-image + ports: + - containerPort: 5432 + replicas: 1 + selector: + matchLabels: + name: spring-boot-app-pod + app: spring-boot-app diff --git a/deploy/k8s/deploy-db.yaml b/deploy/k8s/deploy-db.yaml index e69de29bb..8d7328589 100644 --- a/deploy/k8s/deploy-db.yaml +++ b/deploy/k8s/deploy-db.yaml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: redis-deploy + labels: + name: redis-deploy + app: spring-boot-app +spec: + template: + metadata: + name: redis-pod + labels: + name: redis-pod + app: spring-boot-app + spec: + containers: + - name: redis + image: redis:latest + ports: + - containerPort: 6379 + replicas: 1 + selector: + matchLabels: + name: redis-pod + app: spring-boot-app