mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
57 lines
1.2 KiB
Groovy
57 lines
1.2 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/34-jenkins-vapor'
|
|
)
|
|
}
|
|
}
|
|
|
|
stage('Get Commit Message for Deployment') {
|
|
steps {
|
|
echo $GIT_COMMIT
|
|
echo $GIT_MESSAGE
|
|
}
|
|
}
|
|
|
|
stage('Install') {
|
|
steps {
|
|
sh 'composer update'
|
|
}
|
|
}
|
|
|
|
stage('Tests') {
|
|
steps {
|
|
sh 'vendor/bin/phpunit tests/Unit'
|
|
}
|
|
}
|
|
|
|
stage('Deploy') {
|
|
steps {
|
|
sh 'vendor/bin/vapor deploy staging --message="Test Jenkins"'
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|