Skip to content
Open

Qa #1

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
55d43c1
Dockerfile change
Dec 8, 2021
d17082d
updated the dockerfile
Dec 8, 2021
a6faadc
Create sonar-project.properties
bharu459 Dec 8, 2021
b0932aa
sonar file
Dec 8, 2021
489f0c1
Merge branch 'qa' of https://github.com/bharu459/spring-boot-realworl…
Dec 8, 2021
54adb87
sonar file
Dec 9, 2021
3aeb7a2
Update sonar-project.properties
bharu459 Dec 9, 2021
f7e7104
adding jenkins file
Dec 9, 2021
bf7bcbd
Merge branch 'qa' of https://github.com/bharu459/spring-boot-realworl…
Dec 9, 2021
0adb6da
commited new changes
bharu459 Dec 10, 2021
2c5190c
sonar token change
bharu459 Dec 13, 2021
02b3972
new token passage
bharu459 Dec 13, 2021
44d8038
new token
bharu459 Dec 13, 2021
c91e4da
pvt url
bharu459 Dec 13, 2021
7dd8599
new /
bharu459 Dec 13, 2021
ab757c2
new token
bharu459 Dec 14, 2021
648dd4e
sonar anlaysis new token
bharu459 Dec 14, 2021
de7fa1e
after build only
bharu459 Dec 14, 2021
4698ea9
msg
bharu459 Dec 14, 2021
eab89b1
sony
bharu459 Dec 14, 2021
f2a2b47
msg
bharu459 Dec 14, 2021
3bce770
msg2
bharu459 Dec 14, 2021
20e1ad1
msg
bharu459 Dec 14, 2021
79e3e08
msg 2
bharu459 Dec 14, 2021
d922fa2
msg
bharu459 Dec 15, 2021
f9154d3
new url
bharu459 Dec 15, 2021
86be955
msg
bharu459 Dec 15, 2021
95eafdf
new file
bharu459 Dec 15, 2021
43b6d65
jenkin file with build sonar analysis docker image push code
bharu459 Dec 15, 2021
8084452
token change
bharu459 Dec 16, 2021
6f30640
new sonar file
bharu459 Dec 24, 2021
ab8b37f
new sonar file
bharu459 Dec 24, 2021
b777119
new sonarfile
bharu459 Dec 24, 2021
6f5c5aa
Update sonar-project.properties
bharu459 Dec 25, 2021
002afa0
Deploymentfiles
bharu459 Dec 27, 2021
68c12a8
db deployment file
bharu459 Dec 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.gradle
/build/
#/build/
!gradle/wrapper/gradle-wrapper.jar
*.db

Expand All @@ -19,7 +19,7 @@

### NetBeans ###
nbproject/private/
build/
#build/
nbbuild/
dist/
nbdist/
Expand Down
24 changes: 2 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
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 .

ENTRYPOINT java -jar project-0.0.1-SNAPSHOT.jar
COPY build/libs/*.jar .
ENTRYPOINT java -jar project-0.0.1-SNAPSHOT.jarcommit
61 changes: 61 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
pipeline{
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{
sh " ./gradlew build "
}
}
}
stage("source code analysis"){
steps{
script{
sh " /home/cloud_user/sonar/bin/sonar-scanner "

}
}
}
stage("build image"){
steps{
script{
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} """

}
}
}
}
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 """
}

}
}
}
}
}
Empty file added deploy/k8s/app-service.yaml
Empty file.
Empty file added deploy/k8s/db-service.yaml
Empty file.
25 changes: 25 additions & 0 deletions deploy/k8s/deploy-app.yaml
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions deploy/k8s/deploy-db.yaml
Original file line number Diff line number Diff line change
@@ -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
Empty file.
14 changes: 14 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
d37d66acd3cd88493787e76d03ebc030ddb3d04e# must be unique in a given SonarQube instance
sonar.projectKey=spring_real-world-appfrom_secondpipeline
# --- optional properties ---
# defaults to project key
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 .
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=./build/libs
#sonar.login=d894764e5c4183f535fba6a4becea6a7201a3805