Skip to content

Commit

Permalink
Create upload_docker_image_to_nexus
Browse files Browse the repository at this point in the history
  • Loading branch information
javahometech authored Jan 21, 2019
1 parent d852c6d commit be9cf9f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions upload_docker_image_to_nexus
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
node{

stage('SCM Checkout'){
git branch: 'master',
credentialsId: 'javahometech',
url: 'https://github.com/javahometech/myweb'
}
stage('Maven Build'){
def mvnHome = tool name: 'maven3', type: 'maven'
sh "${mvnHome}/bin/mvn clean package"
sh 'mv target/myweb*.war target/myweb.war'
}
stage('Build Docker Image'){
sh 'docker build -t 13.232.82.187:8083/myweb:2.0.0 .'
}
stage('Upload To Nexus'){

withCredentials([string(credentialsId: 'nexus', variable: 'nexusPwd')]) {
sh "docker login -u admin -p ${nexusPwd} 13.232.82.187:8083"
}

sh "docker push 13.232.82.187:8083/myweb:2.0.0"
}

}

0 comments on commit be9cf9f

Please sign in to comment.