Update 'Jenkinsfile'
All checks were successful
test-multi-branches/pipeline/head This commit looks good
gitea-sync/test/pipeline/head This commit looks good

This commit is contained in:
dany 2022-09-29 19:01:43 +02:00
parent dc909e7069
commit a16cba09b4

34
Jenkinsfile vendored
View File

@ -1,15 +1,5 @@
def remote = [:]
remote.name = 'workstation'
remote.host = 'workstation'
remote.user = 'dany'
remote.identityFile = '/var/jenkins_home/.ssh/id_rsa'
remote.allowAnyHosts = true
remote.agent = false
remote.logLevel = 'INFO'
pipeline{ pipeline{
agent { node{ label'master' }} agent { node{ label'workstation' }}
options { options {
// Limit build history with buildDiscarder option: // Limit build history with buildDiscarder option:
// daysToKeepStr: history is only kept up to this many days. // daysToKeepStr: history is only kept up to this many days.
@ -50,26 +40,8 @@ pipeline{
stage('Remote SSH') { stage('Remote SSH') {
steps { steps {
sh''' sh'''
export -p | tee env.source printenv
cat <<"EOF" >>env.source uname -a
printenv
EOF
'''
sshCommand remote: remote, command: '''#! /bin/bash
set -e
echo $WORKSPACE
pwd
export WORKSPACE="jenkins/workspace/test"
cd $WORKSPACE
bash test.sh
'''
sshScript remote: remote, script: "env.source"
sshCommand remote: remote, command: '''#! /bin/bash
for i in {1..5}; do
echo -n "Loop $i ";
date ;
sleep 1;
done
''' '''
} }
} }