Skip to content

Commit

Permalink
Merge pull request LondheShubham153#76 from LondheShubham153/LondheSh…
Browse files Browse the repository at this point in the history
…ubham153-patch-8

Update Jenkinsfile
  • Loading branch information
LondheShubham153 authored Aug 19, 2023
2 parents bcb64ef + e183f18 commit ac74f93
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 ac74f93

Please sign in to comment.