Migrate source code changes for testing Jenkins/Vapor from personal account to CIEF account

This commit is contained in:
Dillon
2023-06-02 20:33:37 +08:00
parent 619ebc7269
commit e126fd46b7
10 changed files with 75 additions and 7 deletions
+3
View File
@@ -27,3 +27,6 @@ public/*
/storage/app/public
public
/storage/framework/laravel-excel
.vapor/
.env.production
.env.staging
+18
View File
@@ -0,0 +1,18 @@
image: dillonngo/docker-based-image:poc
stages:
- build
Build:
stage: build
services:
- docker:dind
script:
- docker info
# - npm install
# - gulp build
- composer install --no-dev
- vendor/bin/vapor deploy production --message="$CI_COMMIT_MESSAGE"
only:
- test
@@ -30,11 +30,25 @@ abstract class AbstractGetRecord
return $this->filters->only(self::DECORATION_FILTERS);
}
// /**
// * @param null|string $json
// * @return array
// */
// public function deserializeFilters(?string $json): array {
// return $json !== null ? collect(json_decode($json))->toArray() : [];
// }
/**
* @param null|string $json
* @param null|string $param
* @return array
*/
public function deserializeFilters(?string $json): array {
public function deserializeFilters($param): array {
if(gettype($param) == "array"){
$json = implode(',', $param);
}
else{
$json = $param;
}
return $json !== null ? collect(json_decode($json))->toArray() : [];
}
@@ -67,4 +81,4 @@ abstract class AbstractGetRecord
*/
abstract function getResults(Builder $query);
}
}
+3 -1
View File
@@ -30,7 +30,9 @@
"staudenmeir/eloquent-has-many-deep": "^1.7",
"timehunter/laravel-google-recaptcha-v3": "~2.5",
"tymon/jwt-auth": "^1.0",
"webklex/laravel-pdfmerger": "^1.3"
"webklex/laravel-pdfmerger": "^1.3",
"laravel/vapor-cli": "^1.55",
"laravel/vapor-core": "^2.30"
},
"require-dev": {
"facade/ignition": "^2.3.6",
+3
View File
@@ -0,0 +1,3 @@
FROM laravelphp/vapor:php74
COPY . /var/task
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

+9 -2
View File
@@ -2,7 +2,14 @@ export default {
actions: {
crudRequest({getters, dispatch}, {endpoint, method, parameters}){
return dispatch('ensureReCaptchaIsSet').then(function () {
return fetch(endpoint, {
const queryDomain = endpoint.split('?')[0];
const queryParams = encodeURIComponent(endpoint.split('?')[1]);
let encodedParams = queryParams.toString();
let filteredEncodedParams = encodedParams.replace(/%3D/g,'=');
filteredEncodedParams = filteredEncodedParams.replace(/%26/g,'&');
console.log('filteredEncodedParams: ', filteredEncodedParams);
console.log('queryDomain: ', queryDomain);
return fetch(queryDomain + '?' + filteredEncodedParams, {
method: method,
responseType: 'json',
body: parameters ? JSON.stringify(parameters):null,
@@ -23,4 +30,4 @@ export default {
});
}
}
}
}
@@ -105,4 +105,4 @@
</div>
</div>
</transition-component>
@endsection
@endsection
+3
View File
@@ -0,0 +1,3 @@
FROM laravelphp/vapor:php74
COPY . /var/task
+18
View File
@@ -0,0 +1,18 @@
id: 46771
name: vapor-laravel-poc
separate-vendor: true
environments:
production:
memory: 1024
cli-memory: 512
database: vapor-laravel-poc-db
runtime: 'docker'
timeout: 600
build:
- 'composer update'
- 'npm install'
- 'npm run dev'
- 'gulp build'
# - 'rm -rf node_modules'
deploy:
- 'php artisan migrate --force'