Files
Status/Jenkinsfile
vgallegoiz a8bcf18781
Some checks failed
Gitea/Status/pipeline/head There was a failure building this commit
Test Jenkinsfile
2024-05-05 20:21:49 +02:00

30 lines
1001 B
Groovy

pipeline {
agent any
environment {
SSH_CREDENTIALS_ID = 'SSH'
GIT_CREDENTIALS_ID = 'vgallegoiz'
}
stages {
stage('Checkout') {
steps {
// Hace un checkout del repositorio Git utilizando las credenciales de Git
withCredentials([usernamePassword(credentialsId: '${GIT_CREDENTIALS_ID}', usernameVariable: 'GIT_USERNAME', passwordVariable: 'GIT_PASSWORD')]) {
git credentialsId: '${GIT_CREDENTIALS_ID}', url: 'ssh://git@gitssh.mainserverprivate.org:8222/vgallegoiz/Status.git'
}
}
}
stage('Pull') {
steps {
// Ejecuta un Git Pull en el servidor remoto
script {
sshagent(credentials: ['${SSH_CREDENTIALS_ID}']) {
sh 'ssh usuario@192.168.1.39 "cd /home/userpi/Status && git pull"'
}
}
}
}
}
}