Update 'Jenkinsfile'
This commit is contained in:
parent
dc909e7069
commit
a16cba09b4
32
Jenkinsfile
vendored
32
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{
|
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
|
|
||||||
cat <<"EOF" >>env.source
|
|
||||||
printenv
|
printenv
|
||||||
EOF
|
uname -a
|
||||||
'''
|
|
||||||
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
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user