diff --git a/.editorconfig b/.editorconfig index 6f313c6..9a9710a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,4 +12,4 @@ trim_trailing_whitespace = true trim_trailing_whitespace = false [*.yml] -indent_size = 2 +indent_size = 2 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 967315d..dbb821a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,3 +3,4 @@ *.scss linguist-vendored *.js linguist-vendored CHANGELOG.md export-ignore + diff --git a/Dockerfile b/Dockerfile index 769edbf..079dfd0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ COPY database /var/www/database COPY composer-prod.* /var/www/ -RUN composer clearcache && COMPOSER=composer-prod.json composer update --no-scripts +RUN composer clearcache && COMPOSER=composer-prod.json composer install --no-scripts COPY . /var/www @@ -23,3 +23,4 @@ RUN chown -R www-data:www-data \ /var/www/public \ /var/www/storage \ /var/www/bootstrap/cache + diff --git a/Jenkinsfile b/Jenkinsfile index 4dbea50..4a1924f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,30 +1,41 @@ pipeline { - agent { - node { - label 'willa' + agent { + node { + label 'willa' + } } - - } - stages { - stage('build') { - steps { - sh 'cd /home/administrator/apps/$IMAGE_NAME/;docker build -t registry.willaspace.com/willaspace/$IMAGE_NAME:latest .' - sh 'cd /home/administrator/apps/$IMAGE_NAME/;sudo ./BuildDocker' - } + stages { + stage('build') { + when { + branch 'master' + } + steps { + sh 'cd /home/administrator/apps/${IMAGE_NAME}/;docker build -t registry.willaspace.com/willaspace/${IMAGE_NAME}:latest .' + sh 'cd /home/administrator/apps/${IMAGE_NAME}/;sudo ./BuildDocker' + } + } + stage('deploy to production') { + when { + branch 'master' + } + steps { + sh 'cd /home/administrator/apps/${IMAGE_NAME}/ ; docker-compose up -d' + sh 'docker exec willaengine bash -c "COMPOSER=composer-prod.json composer update"' + sh 'docker exec willaengine service cron start' + sh 'docker exec willaengine php artisan config:cache' + sh 'docker exec willaengine php artisan route:cache' + } + } + stage('deploy to staging') { + when { + branch 'dev' + } + steps { + sh 'echo ${IMAGE_NAME}-staging comming soon ...' + } + } } - - stage('deploy') { - steps { - sh 'cd /home/administrator/apps/$IMAGE_NAME/ ; docker-compose up -d' - sh 'docker exec willaengine bash -c "COMPOSER=composer-prod.json composer update"' - sh 'docker exec willaengine service cron start' - sh 'docker exec willaengine php artisan config:cache' - sh 'docker exec willaengine php artisan route:cache' - } + environment { + IMAGE_NAME = 'willaengine' } - - } - environment { - IMAGE_NAME = 'willaengine' - } } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 4a59bdd..58d5f72 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -29,6 +29,7 @@ class Kernel extends ConsoleKernel $schedule->command('sms:update:status rahyab')->everyTwoHours(); $schedule->command('domain:update_ssl_expiry_date')->daily(); # update SSL expired_at $schedule->command('domain:update_domain_expiry_date')->daily(); # update domain expired_at + $schedule->command('make:sitemap')->daily(); # make sitemap } /** diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index a464486..7323ea7 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -2,10 +2,12 @@ namespace App\Exceptions; -use Throwable; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; +use Throwable; +use WM\Core\Exceptions\HasRelationException; use WM\Core\Exceptions\ValidationErrorException; use WM\Core\Services\Responser; +use WM\WebBuilder\Exceptions\SiteBannedException; class Handler extends ExceptionHandler { @@ -31,7 +33,7 @@ class Handler extends ExceptionHandler /** * Report or log an exception. * - * @param \Throwable $exception + * @param \Throwable $exception * @return void */ public function report(Throwable $exception) @@ -46,15 +48,20 @@ class Handler extends ExceptionHandler /** * Render an exception into an HTTP response. * - * @param \Illuminate\Http\Request $request - * @param \Throwable $exception + * @param \Illuminate\Http\Request $request + * @param \Throwable $exception * @return \Illuminate\Http\Response */ public function render($request, Throwable $exception) { if ($exception instanceof ValidationErrorException) { return response()->json(Responser::error($exception->getMessageBody(), $exception->getMessageInfo()), 422); + } elseif ($exception instanceof SiteBannedException) { + return response()->view('webBuilder::errors.template_disabled', ['error' => 'business banned']); + } elseif ($exception instanceof HasRelationException) { + return response()->json(Responser::error([$exception->getMessage()]), 422); } + return parent::render($request, $exception); } } diff --git a/package.json b/package.json index 76e5a51..f42953d 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "dependencies": { "@riophae/vue-treeselect": "^0.4.0", "@tinymce/tinymce-vue": "^3.0.1", - "vue-tinymce-editor": "^1.6.2", "apexcharts": "^3.27.1", "axios": "^0.21.1", "babel-polyfill": "^6.26.0", @@ -45,8 +44,10 @@ "vue-range-component": "^1.0.3", "vue-router": "^3.0.2", "vue-select": "^3.11.2", + "vue-tinymce-editor": "^1.6.2", "vue2-dropzone": "^3.6.0", - "vuetify": "^2.5.4" + "vuetify": "^2.5.4", + "willatoast": "^1.1.1" }, "devDependencies": { "@babel/plugin-syntax-dynamic-import": "^7.2.0", diff --git a/resources/lang/fa/validation.php b/resources/lang/fa/validation.php index 81eb67d..76170c3 100644 --- a/resources/lang/fa/validation.php +++ b/resources/lang/fa/validation.php @@ -27,6 +27,7 @@ return [ "string" => ":attribute باید بین :min و :max کاراکتر باشد.", "array" => ":attribute باید بین :min و :max آیتم باشد.", ], + "after_or_equal" => ":attribute باید بزرگتر یا مساوی :date باشد.", "boolean" => "The :attribute field must be true or false", "confirmed" => ":attribute با تاییدیه مطابقت ندارد.", "date" => ":attribute یک تاریخ معتبر نیست.", @@ -109,6 +110,7 @@ return [ */ 'attributes' => [ + 'today' => 'امروز', 'blog_category_id' => 'دسته بندی', 'slug' => 'نام انگلیسی', 'email' => 'آدرس پست الکترونیکی',