Update 'Jenkinsfile'
This commit is contained in:
parent
dc909e7069
commit
a16cba09b4
34
Jenkinsfile
vendored
34
Jenkinsfile
vendored
@ -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{
|
||||
agent { node{ label'master' }}
|
||||
agent { node{ label'workstation' }}
|
||||
options {
|
||||
// Limit build history with buildDiscarder option:
|
||||
// daysToKeepStr: history is only kept up to this many days.
|
||||
@ -50,26 +40,8 @@ pipeline{
|
||||
stage('Remote SSH') {
|
||||
steps {
|
||||
sh'''
|
||||
export -p | tee env.source
|
||||
cat <<"EOF" >>env.source
|
||||
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
|
||||
printenv
|
||||
uname -a
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user