diff --git a/Jenkinsfile b/Jenkinsfile index ce61da1..f44ef11 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,13 +4,15 @@ node { stage('Clone repository') { /* Cloning the Repository to our Workspace */ - checkout scm + git branch: 'patch-1', url: 'https://github.com/irfanansari568/nodeapp.git' + + } stage('Build image') { /* This builds the actual image */ - app = docker.build("anandr72/nodeapp") + app = docker.build("irfanansari568/nodeapp") } stage('Test image') { @@ -24,9 +26,10 @@ node { /* You would need to first register with DockerHub before you can push images to your account */ - docker.withRegistry('https://registry.hub.docker.com', 'docker-hub') { - app.push("${env.BUILD_NUMBER}") - app.push("latest") + docker.withRegistry('https://registry-1.docker.io/v2/', 'Docker-hub') { + sh "docker login docker.io" + sh "docker push ansari02/nodeapp:10" + } echo "Trying to Push Docker Build to DockerHub" }