From 5d66a2cb1d33c12296fa354c8db535e58a3883e4 Mon Sep 17 00:00:00 2001 From: LandmarkTechnology <70292434+legah2045@users.noreply.github.com> Date: Sat, 15 Jan 2022 10:07:15 -0500 Subject: [PATCH] Create Jenkinsfile_docker --- Jenkinsfile_docker | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Jenkinsfile_docker diff --git a/Jenkinsfile_docker b/Jenkinsfile_docker new file mode 100644 index 0000000000..316ce0930b --- /dev/null +++ b/Jenkinsfile_docker @@ -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" + } + } + + } +}