make new ssh
This commit is contained in:
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
@@ -1,15 +1,6 @@
|
|||||||
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') {
|
||||||
@@ -19,11 +10,14 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('Connect to server') {
|
stage('Connect to server') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
withCredentials([
|
||||||
remote.user = env.CREDS_USR
|
sshUserPrivateKey(
|
||||||
remote.password = env.CREDS_PSW
|
credentialsId: '73d234d2-3f9d-44e9-97fc-b6317070b462',
|
||||||
|
keyFileVariable: 'SSH_PRIVATE_KEY'
|
||||||
|
)
|
||||||
|
]) {
|
||||||
|
sh "ssh -i $SSH_PRIVATE_KEY saccada@saccada.xyz 'find ~/ws'"
|
||||||
}
|
}
|
||||||
sshCommand(remote: remote, command: "find ~/ws")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user