From 76368fd3d55c80cd74ab4c7c90bf1bca31d73c3f Mon Sep 17 00:00:00 2001 From: Bhanu Prakash Reddy <126443511+em-tpt-bbandi@users.noreply.github.com> Date: Mon, 17 Jun 2024 12:00:49 +0530 Subject: [PATCH] Create Jenkinsfile --- Jenkinsfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..65d08c9 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,29 @@ +pipeline { + agent any + stages { + 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 { + cleanWs(cleanWhenNotBuilt: false, + deleteDirs: true, + disableDeferredWipeout: true, + notFailBuild: true, + patterns: [[pattern: '.gitignore', type: 'INCLUDE'], + [pattern: '.propsfile', type: 'EXCLUDE']]) + } + } +}