Skip to content

Commit cb7107b

Browse files
Working on Jenkinsfile for Docker
1 parent 8160a07 commit cb7107b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

JenkinsFileDocker

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,17 @@ pipeline
3737
sh 'docker build -t mithuntechnologies/logindockerjenkins:${buildNumber} .'
3838
}
3939
}
40+
41+
stage("Authenticate and Push Docker Image to Docker Hub")
42+
{
43+
steps()
44+
{
45+
withCredentials([string(credentialsId: 'Docker_Hub_Password', variable: 'Docker_Hub_Password')])
46+
{
47+
sh 'docker login -u mithuntechnologies -p ${Docker_Hub_Password}'
48+
}
49+
sh 'docker push mithuntechnologies/logindockerjenkins:${buildNumber}'
50+
}
51+
}
4052
}
4153
}

0 commit comments

Comments
 (0)