mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/vapor-laravel-explore.git
synced 2026-08-19 04:24:03 +00:00
50 lines
1.1 KiB
Groovy
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: 'test'
|
|
)
|
|
}
|
|
}
|
|
|
|
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"'
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|