拥抱 PHP CI/CD:自动化之路上的救星
2024-05-16

pipeline {
agent any
stages {
stage("Build") {
steps {
checkout scm
sh "composer install"
sh "phpunit"
}
}
stage("Deploy") {
when { expression { sh script: "exit 0" } }
steps {
sshagent(["ssh-key"]) {
sh "ssh -o StrictHosTKEyChecking=no user@server "cd /var/www/my-app && git pull && composer install && phpunit""
}
}
}
}
}
登录后复制