Files
exchange-2.0/Jenkinsfile
2023-08-24 19:22:20 +08:00

50 lines
1.1 KiB
Groovy

// Webhook + Gitlab git pull + Vapor
def payload = readJSON text: "${payload}"
String userName = payload.user_name
String userEmail = payload.user_email
String httpUrl = payload.project.http_url
pipeline {
agent {
docker {
image 'dillonngo/docker-based-image:poc'
args "--group-add 992 -v /var/run/docker.sock:/var/run/docker.sock"
}
}
environment {
HOME = '.'
}
stages {
stage('Download source code from Git') {
steps {
git(
url: httpUrl,
credentialsId: 'gitlab-jenkins-localhost',
branch: 'dillon/jenkins-vapor-34-vue-polling'
)
}
}
stage('Install') {
steps {
sh 'composer update'
}
}
stage('Tests') {
steps {
sh 'vendor/bin/phpunit tests/Unit'
}
}
stage('Deploy') {
steps {
sh 'vendor/bin/vapor deploy production --message="Test Jenkins"'
}
}
}
}