Files
Status/Jenkinsfile
2024-05-05 21:01:05 +02:00

24 lines
834 B
Groovy

pipeline {
agent any
stages {
stage('Checkout') {
steps {
// Hace un checkout del repositorio Git utilizando las credenciales SSH
git credentialsId: 'SSH', url: 'ssh://git@gitssh.mainserverprivate.org:8222/vgallegoiz/Status.git', branch: 'main'
}
}
stage('Pull') {
steps {
script {
// Establecer credenciales
def username = 'tu_usuario'
def password = 'tu_contraseña'
// Ejecutar un Git Pull en el servidor remoto
sh "sshpass -p '${password}' ssh -o StrictHostKeyChecking=no ${username}@192.168.1.39 'cd /home/userpi/Status && git pull'"
}
}
}
}
}