Skip to content

Commit

Permalink
Update Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
LondheShubham153 authored Aug 19, 2023
1 parent bcb64ef commit e183f18
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
pipeline {
agent { label "dev-server" }
agent any

stages{
stage("Clone Code"){
stage("Code"){
steps{
git url: "https://github.com/LondheShubham153/node-todo-cicd.git", branch: "master"
}
}
stage("Build and Test"){
stage("Build & Test"){
steps{
sh "docker build . -t node-app-test-new"
}
}
stage("Push to Docker Hub"){
stage("Push to DockerHub"){
steps{
withCredentials([usernamePassword(credentialsId:"dockerHub",passwordVariable:"dockerHubPass",usernameVariable:"dockerHubUser")]){
sh "docker tag node-app-test-new ${env.dockerHubUser}/node-app-test-new:latest"
sh "docker login -u ${env.dockerHubUser} -p ${env.dockerHubPass}"
sh "docker push ${env.dockerHubUser}/node-app-test-new:latest"
sh "docker login -u ${env.dockerHubUser} -p ${env.dockerHubPass}"
sh "docker tag node-app-test-new ${env.dockerHubUser}/node-app-test-new:latest"
sh "docker push ${env.dockerHubUser}/node-app-test-new:latest"
}
}
}
Expand Down

0 comments on commit e183f18

Please sign in to comment.