2022-08-01 11:19:01 +02:00
|
|
|
pipline{
|
2022-07-29 13:58:41 +02:00
|
|
|
def remote = [:]
|
|
|
|
remote.name = 'workstation'
|
2022-07-29 14:21:45 +02:00
|
|
|
remote.host = 'workstation'
|
2022-07-29 13:58:41 +02:00
|
|
|
remote.user = 'dany'
|
2022-07-29 14:34:36 +02:00
|
|
|
remote.identityFile = '/var/jenkins_home/.ssh/id_rsa'
|
2022-07-29 13:58:41 +02:00
|
|
|
remote.allowAnyHosts = true
|
2022-07-29 14:29:37 +02:00
|
|
|
remote.agent = false
|
2022-07-29 14:37:48 +02:00
|
|
|
remote.logLevel = 'INFO'
|
2022-07-29 14:46:30 +02:00
|
|
|
stage('Test')
|
|
|
|
{
|
2022-08-01 11:19:01 +02:00
|
|
|
sh '''
|
|
|
|
printenv;
|
|
|
|
echo $WORKSPACE;
|
|
|
|
ls -al $WORKSPACE;
|
|
|
|
find /var/jenkins_home -name "Jenkinsfile";
|
|
|
|
'''
|
2022-07-29 14:46:30 +02:00
|
|
|
}
|
2022-07-29 13:58:41 +02:00
|
|
|
stage('Remote SSH') {
|
2022-08-01 11:19:01 +02:00
|
|
|
sshCommand remote: remote, command: '''
|
|
|
|
cd $(dirname $(find ~/jenkins/workspace/ant-http@script -name "Jenkinsfile"));
|
|
|
|
bash test.sh;
|
|
|
|
'''
|
2022-07-29 13:58:41 +02:00
|
|
|
sshCommand remote: remote, command: "for i in {1..5}; do echo -n \"Loop \$i \"; date ; sleep 1; done"
|
|
|
|
}
|
2022-08-01 11:19:01 +02:00
|
|
|
}
|