Merge branch 'dev'

pull/150/head^2
farid 3 years ago
commit 1f4a2c5061

@ -3,3 +3,5 @@ vendor
node_modules
modules
composer.lock
Dockerfile*
Jenkinsfile

@ -0,0 +1,43 @@
kind: pipeline
type: exec
name: default
steps:
- name: build to production
commands:
- sudo cp /home/administrator/apps/willaengine/composer-prod.json .
- docker build -t registry.willaspace.com/willaspace/willaengine:latest --build-arg COMPOSER_FILE_NAME=composer-prod .
when:
branch:
- master
- name: deploy to production
commands:
- cd /home/administrator/apps/willaengine/ ; docker-compose up -d
- docker exec willaengine bash -c "COMPOSER=composer-prod.json composer update"
- docker exec willaengine service cron start
- docker exec willaengine php artisan config:cache
- docker exec willaengine php artisan route:cache
when:
branch:
- master
- name: build to staging
commands:
- docker build -t registry.willaspace.com/willaspace/willaengine-staging:latest --build-arg COMPOSER_FILE_NAME=composer-staging -f Dockerfile.staging .
- docker build -t registry.willaspace.com/willaspace/willaengine-staging-nginx:latest -f Dockerfile.nginx .
when:
branch:
- dev
- name: deploy to staging
commands:
- cd /apps/willaengine-staging/ ; docker-compose up -d
when:
branch:
- dev
trigger:
branch:
- master
- dev

3
.gitignore vendored

@ -3,7 +3,6 @@
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,laravel,vuejs,phpstorm
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,laravel,vuejs,phpstorm
composer-prod.json
### Laravel ###
/vendor/
@ -152,5 +151,3 @@ fabric.properties
# Recommended template: Node.gitignore
dist/

@ -14,7 +14,7 @@ npm install
rm -r /home/administrator/apps/willaengine/public/js/vue
npm run production
npm run prod
rm -r /home/administrator/apps/nginx/www/willaengine/public/js/vue
rm -r /home/administrator/apps/nginx/www/willamall/public/js/vue

@ -1,25 +1,4 @@
FROM dfs1368/laravel-php-fpm:7.4.1
WORKDIR /var/www
RUN apt install -y sendmail libpng-dev
RUN docker-php-ext-install gd
RUN printf 'upload_max_filesize=300M;\npost_max_size=300M;\nmax_execution_time=600;\nmax_input_time=600;\n' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini;
RUN echo 'pm.max_children = 100' >> /usr/local/etc/php-fpm.d/zz-docker.conf
COPY database /var/www/database
COPY composer-prod.* /var/www/
RUN composer clearcache && COMPOSER=composer-prod.json composer install --no-scripts
COPY . /var/www
FROM fsaravi/standard-laravel:7.4
WORKDIR /var/www/html
RUN php artisan morphmap:cache
RUN chown -R www-data:www-data \
/var/www/public \
/var/www/storage \
/var/www/bootstrap/cache

@ -0,0 +1,3 @@
FROM nginx:1.21.1
COPY public /var/www/html/public

@ -0,0 +1,6 @@
FROM fsaravi/standard-laravel:7.4
WORKDIR /var/www/html
RUN php artisan morphmap:cache

36
Jenkinsfile vendored

@ -3,26 +3,46 @@ pipeline {
node {
label 'willa'
}
}
stages {
stage('build') {
stage('build for production') {
when {
branch 'master'
}
steps {
sh 'docker build -t registry.willaspace.com/willaspace/${IMAGE_NAME}:latest --build-arg ssh_prv_key="$(cat /home/administrator/.ssh/id_rsa)" .'
sh 'cd /home/administrator/apps/${IMAGE_NAME}/;sudo ./BuildDocker'
}
}
stage('build for staging') {
when {
branch 'dev'
}
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'
sh 'docker build -t registry.willaspace.com/willaspace/${IMAGE_NAME}-staging:latest -f Dockerfile.staging --build-arg ssh_prv_key="$(cat /home/administrator/.ssh/id_rsa)" .'
sh 'docker build -t registry.willaspace.com/willaspace/${IMAGE_NAME}-staging-nginx:latest -f Dockerfile.nginx .'
}
}
stage('deploy') {
stage('deploy to production') {
when {
branch 'master'
}
steps {
sh 'cd /home/administrator/apps/$IMAGE_NAME/ ; docker-compose up -d'
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 'cd /apps/${IMAGE_NAME}-staging/ ; docker-compose up -d'
}
}
}
environment {
IMAGE_NAME = 'willaengine'

@ -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
}
/**

@ -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
{
@ -54,7 +56,12 @@ class Handler extends ExceptionHandler
{
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);
}
}

@ -0,0 +1,163 @@
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.4",
"coraxster/flysystem-aws-s3-v3-minio": "^1.0",
"fideloper/proxy": "^4.0",
"laravel/framework": "^8.0",
"laravel/passport": "^10",
"laravel/tinker": "^2.0",
"maatwebsite/excel": "^3.1",
"kalnoy/nestedset": "^6.0",
"sentry/sentry-laravel": "^2.3",
"spatie/laravel-medialibrary": "^8.0.0",
"io-developer/php-whois": "^4.0",
"silber/bouncer": "v1.0.0-rc.10",
"wm/blog": "dev-master",
"wm/common": "dev-master",
"wm/core": "dev-master",
"wm/crm": "dev-master",
"wm/portfolio": "dev-master",
"wm/product": "dev-master",
"wm/service": "dev-master",
"wm/store": "dev-master",
"wm/finance": "dev-master",
"wm/admin": "dev-master",
"wm/web-builder": "dev-master",
"wm/app-management": "dev-master",
"wm/notification": "dev-master",
"wm/roll-call": "dev-master",
"wm/lms": "dev-master",
"wm/service-store": "dev-master",
"wm/contact-us": "dev-master",
"zircote/swagger-php": "^3.0"
},
"provide": {
"ext-imagick": "*"
},
"require-dev": {
"facade/ignition": "^2.3.6",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Modules\\": "Modules/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan morphmap:cache"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"repositories": [
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/crm.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/common.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/core.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/blog.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/portfolio.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/product.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/service.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/store.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/notification.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/roll-call.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/app-management.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/web-builder.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/finance.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/service-store.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/admin.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/lms.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/contact-us.git"
}
]
}

@ -0,0 +1,164 @@
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.4",
"coraxster/flysystem-aws-s3-v3-minio": "^1.0",
"fideloper/proxy": "^4.0",
"laravel/framework": "^8.0",
"laravel/passport": "^10",
"laravel/tinker": "^2.0",
"maatwebsite/excel": "^3.1",
"kalnoy/nestedset": "^6.0",
"sentry/sentry-laravel": "^2.3",
"spatie/laravel-medialibrary": "^8.0.0",
"io-developer/php-whois": "^4.0",
"silber/bouncer": "v1.0.0-rc.10",
"wm/blog": "dev-master",
"wm/common": "dev-master",
"wm/core": "dev-master",
"wm/crm": "dev-master",
"wm/portfolio": "dev-master",
"wm/product": "dev-master",
"wm/service": "dev-master",
"wm/store": "dev-master",
"wm/finance": "dev-master",
"wm/admin": "dev-master",
"wm/web-builder": "dev-master",
"wm/app-management": "dev-master",
"wm/notification": "dev-master",
"wm/roll-call": "dev-master",
"wm/lms": "dev-master",
"wm/service-store": "dev-master",
"wm/contact-us": "dev-master",
"zircote/swagger-php": "^3.0"
},
"provide": {
"ext-imagick": "*"
},
"require-dev": {
"facade/ignition": "^2.3.6",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Modules\\": "Modules/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan morphmap:cache"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"repositories": [
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/crm.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/common.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/core.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/blog.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/portfolio.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/product.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/service.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/store.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/notification.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/roll-call.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/app-management.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/web-builder.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/finance.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/service-store.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/admin.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/lms.git"
},
{
"type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/contact-us.git"
}
]
}

8136
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -3,16 +3,16 @@
"scripts": {
"dev": "npm run development",
"development": "mix",
"staging": "npm run production -- --mix-config=webpack.mix.staging",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"prod": "npm run production -- --mix-config=webpack.mix.production",
"production": "mix --production"
},
"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,18 +45,21 @@
"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",
"@babel/preset-env": "^7.14.5",
"cross-env": "^5.2.1",
"laravel-mix": "^6.0.24",
"minimist": "^1.2.5",
"node-sass": "^6.0.0",
"popper.js": "^2.0.0-next.4",
"sass": "^1.35.1",
"sass-loader": "^12.1.0",
"popper.js": "^2.0.0-next.4",
"vue": "^2.6.14",
"vue-loader": "^15.9.7",
"vue-masonry-css": "^1.0.3",

@ -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' => 'آدرس پست الکترونیکی',

@ -3,8 +3,17 @@
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Support\Facades\Http;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
/**
* @return \WM\Core\Services\HttpTestProvider Http request provider for test enviroment
*/
public function makeHttpReqeust($url)
{
return \WM\Core\Services\HttpTestProvider::init($url);
}
}

5
webpack.mix.js vendored

@ -49,9 +49,10 @@ require('./modules/wm-roll-call/webpack.mix');
require('./modules/wm-finance/webpack.mix');
require('./modules/wm-app-management/webpack.mix');
require('./modules/wm-web-builder/webpack.mix');
// require('./modules/wm-service-store/webpack.mix');
require('./modules/wm-lms/webpack.mix');
require('./modules/wm-service-store/webpack.mix');
// require('./modules/wm-warehouse/webpack.mix');
// require('./modules/wm-reservation/webpack.mix');
// require('./modules/wm-contact-us/webpack.mix');
require('./modules/wm-contact-us/webpack.mix');
mix.version();

@ -0,0 +1,58 @@
const mix = require('laravel-mix');
const path = require('path');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.webpackConfig({
resolve: {
extensions: ["*", ".js", ".jsx", ".vue", ".ts", ".tsx", '.json', '.d.ts'],
alias: {
'@JS': path.resolve(__dirname, 'resources/js'),
'@Home': path.resolve(__dirname, 'resources/js/Home'),
},
},
output: {
chunkFilename: 'js/vue/chunks/[name].[chunkhash].js',
},
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
options: { appendTsSuffixTo: [/\.vue$/] },
exclude: /node_modules/
}
]
}
});
mix.js('resources/js/Home/app.js', 'public/js/vue/Home').vue({version: 2});
require('./modules/wm-core/webpack.mix');
require('./modules/wm-common/webpack.mix');
require('./modules/wm-crm/webpack.mix');
require('./modules/wm-blog/webpack.mix');
require('./modules/wm-portfolio/webpack.mix');
require('./modules/wm-product/webpack.mix');
require('./modules/wm-service/webpack.mix');
require('./modules/wm-store/webpack.mix');
require('./modules/wm-admin/webpack.mix');
require('./modules/wm-notification/webpack.mix');
require('./modules/wm-roll-call/webpack.mix');
require('./modules/wm-finance/webpack.mix');
require('./modules/wm-app-management/webpack.mix');
require('./modules/wm-web-builder/webpack.mix');
require('./modules/wm-lms/webpack.mix');
require('./modules/wm-service-store/webpack.mix');
require('./modules/wm-contact-us/webpack.mix');
// require('./modules/wm-warehouse/webpack.mix');
// require('./modules/wm-reservation/webpack.mix');
mix.version();

@ -0,0 +1,45 @@
const mix = require('laravel-mix');
const path = require('path');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.webpackConfig({
resolve: {
extensions: ["*", ".js", ".jsx", ".vue", ".ts", ".tsx", '.json', '.d.ts'],
alias: {
'@JS': path.resolve(__dirname, 'resources/js'),
'@Home': path.resolve(__dirname, 'resources/js/Home'),
},
},
output: {
chunkFilename: 'js/vue/chunks/[name].[chunkhash].js',
},
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
options: { appendTsSuffixTo: [/\.vue$/] },
exclude: /node_modules/
}
]
}
});
mix.js('resources/js/Home/app.js', 'public/js/vue/Home').vue({version: 2});
require('./vendor/wm/core/webpack.mix');
require('./vendor/wm/common/webpack.mix');
require('./vendor/wm/crm/webpack.mix');
require('./vendor/wm/blog/webpack.mix');
// require('./vendor/wm/warehouse/webpack.mix');
// require('./vendor/wm/reservation/webpack.mix');
mix.version();
Loading…
Cancel
Save