Skip to content

Commit

Permalink
Update Jenkins_Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
em-tpt-bbandi authored Jun 24, 2024
1 parent 05c86ea commit 9a5dcbb
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions Jenkins_Docker
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
pipeline {
agent any

stages {
stage('Checkout') {
steps {
script {
// Checkout the specified branch
git branch: "${BRANCH_NAME}", url: 'https://github.com/beckn/protocol-server.git'
}
}
}
// stages {
// stage('Checkout') {
// steps {
// script {
// // Checkout the specified branch
// git branch: "${BRANCH_NAME}", url: 'https://github.com/beckn/protocol-server.git'
// }
// }
// }

stage('Build Docker Image') {
steps {
Expand All @@ -36,9 +36,26 @@ pipeline {
// Push the Docker image to Docker Hub
sh "docker push ${DOCKERHUB_REPO}:${BRANCH_NAME}"
}
}
}
}

stage('Executing Shell Script On Server') {
steps {
script {
sshagent(credentials: ['"${credentials}"']) {
sh '''
ssh -t -t ${userName}@${hostIP} -o StrictHostKeyChecking=no << EOF
${listOfCommands}
logout
EOF
'''
}
}
}
}
}



post {
always {
Expand All @@ -55,4 +72,3 @@ pipeline {
}
}
}
// hi

0 comments on commit 9a5dcbb

Please sign in to comment.