Skip to content

Commit

Permalink
Create pipeline-docker-ci-cd
Browse files Browse the repository at this point in the history
  • Loading branch information
javahometech authored May 10, 2018
1 parent 98a62db commit f4ce505
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pipeline-docker-ci-cd
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

node{
stage('Git Checkout'){
git url: 'https://github.com/javahometech/my-app',
branch:'master'
}
stage('MVN Package'){
def mvnHome = tool name: 'maven-3', type: 'maven'
sh "${mvnHome}/bin/mvn clean package"
}
stage('Build Docker Image'){
sh 'docker build -t kammana/my-app:0.0.1 .'
}

stage('Upload Image to DockerHub'){
withCredentials([string(credentialsId: 'docker-hub', variable: 'password')]) {
sh "docker login -u kammana -p ${password}"
}

sh 'docker push kammana/my-app:0.0.1'
}
}

0 comments on commit f4ce505

Please sign in to comment.