Skip to content

Commit

Permalink
Create Jenkinsfile_docker
Browse files Browse the repository at this point in the history
  • Loading branch information
legah2045 authored Jan 15, 2022
1 parent 590a439 commit 5d66a2c
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions Jenkinsfile_docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
pipeline{
agent any
tools{
maven "maven3.8.4"
}
stages{
stage('GitClone'){
steps{
echo "cloning the lastest applications version"
git "https://github.com/LandmakTechnology/maven-web-application"
}
}
stage('Test+Build'){
steps{
sh "echo Running unitTesting"
sh "mvn clean package"
echo "echo test successful and backupArtifacts created"
}
}
stage('codeQuality'){
steps{
sh "echo Running detail code analysis"
sh "mvn sonar:sonar"
sh "echo All conditions met/passed"
}
}
stage('upLoadArtifacts'){
steps{
sh "echo Running detail code analysis"
sh "mvn deploy"
sh "echo backupArtifacts in nexus"
}
}
stage('predeployment'){
steps{
sh "echo creating docker image"
sh "docker build -t mylandmarktech/maven-web-app . "
sh "docker push mylandmarktech/maven-web-app"
}
}
stage('UnDeploy'){
steps{
sh "echo UNDEPLOYING existing application"
sh "docker rm -f webapp"
}
}
stage('deployment'){
steps{
sh "echo application ready for deployment"
sh "docker run -d -p 8000:8080 --name webapp mylandmarktech/maven-web-app"
}
}
stage('emailNotification'){
steps{
sh "echo deployment successful"
}
}

}
}

0 comments on commit 5d66a2c

Please sign in to comment.