make new ssh

This commit is contained in:
Basyrov Rustam
2025-06-09 11:58:45 +03:00
parent 92498c074c
commit 0169c28170

20
Jenkinsfile vendored
View File

@@ -1,15 +1,6 @@
def remote=[:]
remote.name = 'saccada.xyz'
remote.host = 'saccada.xyz'
remote.allowAnyHosts = true
pipeline {
agent any
environment {
CREDS=credentials('73d234d2-3f9d-44e9-97fc-b6317070b462')
}
stages {
stage('Hello') {
@@ -19,11 +10,14 @@ pipeline {
}
stage('Connect to server') {
steps {
script {
remote.user = env.CREDS_USR
remote.password = env.CREDS_PSW
withCredentials([
sshUserPrivateKey(
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")
}
}
}