init ssh command
This commit is contained in:
24
Jenkinsfile
vendored
24
Jenkinsfile
vendored
@@ -1,11 +1,35 @@
|
|||||||
|
def remote=[:]
|
||||||
|
remote.name = 'saccada.xyz'
|
||||||
|
remote.host = 'saccada.xyz'
|
||||||
|
remote.allowAnyHosts = true
|
||||||
|
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
|
environment {
|
||||||
|
CREDS=credentials('73d234d2-3f9d-44e9-97fc-b6317070b462')
|
||||||
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Hello') {
|
stage('Hello') {
|
||||||
steps {
|
steps {
|
||||||
echo 'Hello from Jenkins'
|
echo 'Hello from Jenkins'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stage('Connect to server') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
remote.user = env.CREDS_USR
|
||||||
|
remote.password = env.CREDS_PSW
|
||||||
|
}
|
||||||
|
sshCommand(remote: remote, command: "find ~/ws")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
sleep 5
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user