Jenkins Vapor initial commit

This commit is contained in:
Dillon
2023-09-26 20:24:15 +08:00
parent 99f4699260
commit 16c45a36d2
6 changed files with 84 additions and 0 deletions
+3
View File
@@ -25,3 +25,6 @@ package-lock.json
public/*
/public/*
storage/framework/laravel-excel/*
.vapor/
.env.production
.env.staging
Vendored
+49
View File
@@ -0,0 +1,49 @@
// 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('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"'
}
}
}
}
+1
View File
@@ -17,6 +17,7 @@
"intervention/image": "^2.5",
"laravel/framework": "^8.40",
"laravel/tinker": "^2.5",
"laravel/vapor-core": "^2.33",
"maatwebsite/excel": "^3.1",
"rinvex/countries": "^6.1",
"spatie/laravel-activitylog": "^3.14",
+3
View File
@@ -0,0 +1,3 @@
FROM laravelphp/vapor:php74
COPY . /var/task
+3
View File
@@ -0,0 +1,3 @@
FROM laravelphp/vapor:php74
COPY . /var/task
+25
View File
@@ -0,0 +1,25 @@
id: 52493
name: shipping-portal
environments:
production:
memory: 1024
cli-memory: 512
database: vapor-laravel-poc-db
storage: shipping-portal-production
runtime: 'docker'
timeout: 180
build:
- 'composer update'
- 'npm install'
- 'npm run dev'
- 'gulp build'
deploy:
- 'php artisan migrate --force'
# staging:
# memory: 1024
# cli-memory: 512
# runtime: 'php-8.2:al2'
# build:
# - 'COMPOSER_MIRROR_PATH_REPOS=1 composer install'
# - 'php artisan event:cache'
# - 'npm ci && npm run dev && rm -rf node_modules'