Test Jenkinsfile
Some checks failed
Gitea/Status/pipeline/head There was a failure building this commit

This commit is contained in:
2024-05-05 20:18:20 +02:00
parent 8720624f1a
commit 3b14e9829e

10
Jenkinsfile vendored
View File

@@ -1,14 +1,18 @@
pipeline { pipeline {
agent any agent any
environment { environment {
SSH_CREDENTIALS_ID = 'SSH' SSH_CREDENTIALS_ID = 'SSH'
GIT_CREDENTIALS_ID = 'Gitea-user'
} }
stages { stages {
stage('Checkout') { stage('Checkout') {
steps { steps {
// Hace un checkout del repositorio Git // Hace un checkout del repositorio Git utilizando las credenciales de Git
git 'ssh://git@gitssh.mainserverprivate.org:8222/vgallegoiz/Status.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'
}
} }
} }
@@ -16,9 +20,11 @@ pipeline {
steps { steps {
// Ejecuta un Git Pull en el servidor remoto // Ejecuta un Git Pull en el servidor remoto
script { script {
sshagent(credentials: ['${SSH_CREDENTIALS_ID}']) {
sh 'ssh usuario@192.168.1.39 "cd /home/userpi/Status && git pull"' sh 'ssh usuario@192.168.1.39 "cd /home/userpi/Status && git pull"'
} }
} }
} }
} }
}
} }