Merge branch 'postProdFixes' into 'develop'

Post prod fixes

See merge request service-web-lab/tracabilite-loue!13
This commit is contained in:
Vincent BRIDIER 2022-12-12 12:36:30 +00:00
commit 61acab1cb1
7 changed files with 879 additions and 1268 deletions

View file

@ -1,11 +1,11 @@
image: $CI_REGISTRY/service-web-lab/ldc-web-images-docker/ldcweb-qa:php7.3-1.0
stages:
- Security
- CodingStandards
- Builds
composer-security:
stage: Security
image: $CI_REGISTRY/service-web-lab/ldc-web-images-docker/ldcweb-qa:php7.3-1.0
script:
- local-php-security-checker --format=json --path=./composer.lock > composer-security-checker-report.json
artifacts:
@ -14,9 +14,13 @@ composer-security:
paths:
- composer-security-checker-report.json
allow_failure: true
needs: []
npm-security:
stage: Security
image: node:17.9.1
before_script:
- npm install --location=global audit-ci@^6
script:
- audit-ci -p npm -o json > npm-security-checker-report.json
artifacts:
@ -25,9 +29,11 @@ npm-security:
paths:
- npm-security-checker-report.json
allow_failure: true
needs: []
phpcs:
stage: CodingStandards
image: $CI_REGISTRY/service-web-lab/ldc-web-images-docker/ldcweb-qa:php7.3-1.0
before_script:
- composer config gitlab-token.gitlab.com $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
- composer install
@ -44,3 +50,26 @@ phpcs:
reports:
junit: phpcs-report.xml
allow_failure: false
needs:
- composer-security
- npm-security
front-build:
stage: Builds
image: node:17.9.1
before_script:
- npm install
cache:
paths:
- node_modules/
script:
- npm run prod > front-build-report.json
artifacts:
when: on_failure
expose_as: 'front-build-report'
paths:
- front-build-report.json
allow_failure: false
needs:
- phpcs

View file

@ -30,11 +30,11 @@ class Kernel extends ConsoleKernel
protected function schedule(Schedule $schedule)
{
// * Jobs cafel sur queue cafel
$schedule->job(CafelFoodJob::class, 'cafel')->onOneServer()->everyThreeHours();
$schedule->job(CafelBeaVolJob::class, 'cafel')->onOneServer()->everyThreeHours();
$schedule->job(CafelMepEggJob::class, 'cafel')->onOneServer()->everyThreeHours();
$schedule->job(CafelEggBreederJob::class, 'cafel')->onOneServer()->everyThreeHours();
$schedule->job(CafelPoultryBreederJob::class, 'cafel')->onOneServer()->everyThreeHours();
$schedule->job(CafelFoodJob::class, 'cafel')->onOneServer()->everySixHours();
$schedule->job(CafelBeaVolJob::class, 'cafel')->onOneServer()->everySixHours();
$schedule->job(CafelMepEggJob::class, 'cafel')->onOneServer()->everySixHours();
$schedule->job(CafelEggBreederJob::class, 'cafel')->onOneServer()->everySixHours();
$schedule->job(CafelPoultryBreederJob::class, 'cafel')->onOneServer()->everySixHours();
$schedule->job(XmlFluxEggJob::class, 'tracea')->onOneServer()->dailyAt('02:00');
$schedule->job(XmlFluxPoultryJob::class, 'tracea')->onOneServer()->dailyAt('22:00');

View file

@ -23,7 +23,7 @@ class RemoveOldXmlEntries
}
try {
$q = TraceaEgg::query();
$q->where('dcr', '<=', now()->subMonths(config('tracea.keepEggMonths', 12)))->destroy();
$q->where('dcr', '<=', now()->subMonths(config('tracea.keepEggMonths', 12)));
$q->delete();
} catch (\Exception $e) {
report($e);

View file

@ -99,8 +99,8 @@ class CafelEggBreeder extends Model
{
// * EVENT CLOSURES.
static::creating(function (self $model) {
return self::areInuavCodesUniques($model);
return self::isEdeCodeUnique($model);
self::areInuavCodesUniques($model);
self::isEdeCodeUnique($model);
});
static::updating(function (self $model) {
if ($model->getRawOriginal('path_picture_1') !== $model->path_picture_1) {
@ -109,8 +109,8 @@ class CafelEggBreeder extends Model
if ($model->getRawOriginal('path_picture_2') !== $model->path_picture_2) {
Storage::delete(\public_path($model->getRawOriginal('path_picture_2')));
}
return self::areInuavCodesUniques($model);
return self::isEdeCodeUnique($model);
self::areInuavCodesUniques($model);
self::isEdeCodeUnique($model);
});
static::deleting(function (self $model) {
if ($model->getRawOriginal('path_picture_1')) {

File diff suppressed because it is too large Load diff

View file

@ -10,10 +10,12 @@
<div class="header">
<p>Vous venez de scanner :</p>
<p>Œufs fermiers de Loué de <br> poules élevées en liberté</p>
<p>{{ $dataVisuel->libelle }}</p>
<p>{{ optional($dataVisuel)->libelle }}</p>
</div>
<div class="body">
@if($dataVisuel)
<img src="{{ asset($dataVisuel->path) }}" alt="œufs" class="box_img">
@endif
<div class="date">
<p>Ces œufs ont été pondus le :</p>
<p>{{ Carbon\Carbon::parse($datePonte)->format('d/m/Y') }}</p>

View file

@ -104,4 +104,4 @@ Route::fallback(function () {
if (request()->getHost() === config('app.egg_domain')) {
return redirect(config('app.url'));
}
});
});