Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkins CI pipeline #39

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
pipeline {
agent any
tools {
maven "maven3.8.4"
}
stages{
stages('Gitclone') {
steps{
sh "echo clone the latest applicatios version"
git https://github.com/Pline-org/Maven-web-application
}
}
stages('Testbuild'){
steps{
sh "echo Running unitTesting"
sh "echo unitTesting ok. Creating packages"
sh "mvn clean package"
sh "echo Artifacts created"
}
}
stages('codeQuality'){
steps{
sh "echo Running codeQuality Report"
sh "mvn sonar:sonar"
}
}
stages('uploadArtifacts'){
steps{
sh "echo uploadArtifacts into nexus"
sh "mvn deploy"

}
}
stages('message'){
steps{
sh "echo CI job successful"
}

}

}

}

2. Continious Deployment job:
Deploy to docker

pipeline{
agent any
stages{
stages( 'predeployment'){
steps{
sh "docker build"
// sh "docker login -u mylamndmarktech"
sh "docker push"

}
}
stages( 'deployment'){
steps{
sh "echo ready for deployment"
sh "docker run"
}
}
}
}
}
67 changes: 67 additions & 0 deletions delarative pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
pipeline {
agent any
tools {
maven "maven3.8.4"
}
stages{
stages('Gitclone') {
steps{
sh "echo clone the latest applicatios version"
git https://github.com/Pline-org/Maven-web-application
}
}
stages('Testbuild'){
steps{
sh "echo Running unitTesting"
sh "echo unitTesting ok. Creating packages"
sh "mvn clean package"
sh "echo Artifacts created"
}
}
stages('codeQuality'){
steps{
sh "echo Running codeQuality Report"
sh "mvn sonar:sonar"
}
}
stages('uploadArtifacts'){
steps{
sh "echo uploadArtifacts into nexus"
sh "mvn deploy"

}
}
stages('message'){
steps{
sh "echo CI job successful"
}

}

}

}

2. Continious Deployment job:
Deploy to docker

pipeline{
agent any
stages{
stages( 'predeployment'){
steps{
sh "docker build"
// sh "docker login -u mylamndmarktech"
sh "docker push"

}
}
stages( 'deployment'){
steps{
sh "echo ready for deployment"
sh "docker run"
}
}
}
}
}
11 changes: 4 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@
<spring.version>5.1.2.RELEASE</spring.version>
<junit.version>4.11</junit.version>
<log4j.version>1.2.17</log4j.version>
<sonar.host.url>http:3.238.135.186:9000/</sonar.host.url>
<sonar.host.url>http://3.83.31.247:9000/</sonar.host.url>
<sonar.login>admin</sonar.login>
<sonar.password>admin</sonar.password>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<properties>
<sonar.organization>mylandmarktechs</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>

</properties>

<dependencies>
Expand Down Expand Up @@ -101,13 +98,13 @@
<repository>
<id>nexus</id>
<name>Landmark Technologies Releases Nexus Repository</name>
<url>http://44.192.81.238:8888/mylandmarktech/repository/boa-release/</url>
<url>http://54.159.14.22:8000/repository/cbank-release/</url>
</repository>

<snapshotRepository>
<id>nexus</id>
<name>Landmark Technologies Snapshot Nexus Repository </name>
<url>http://44.192.81.238:8888/mylandmarktech/repository/boa-snapshot/</url>
<url>http://54.159.14.22:8000/repository/cbank-snapshot/</url>
</snapshotRepository>

</distributionManagement>
Expand Down