From 79b141d07082f68489de2e0460615af4ff3375e8 Mon Sep 17 00:00:00 2001 From: Ruslan Baidan Date: Wed, 30 Oct 2019 10:53:05 +0100 Subject: [PATCH] Cleaned up the scripts and vagrant bootstrap, updarted the docs. --- .gitignore | 1 + INSTALL/INSTALL.rhel7.md | 10 +- INSTALL/INSTALL.ubuntu1604.md | 10 +- INSTALL/INSTALL.ubuntu1804.md | 10 +- composer.json | 4 +- composer.lock | 187 +++++++++++++++--------------- config/autoload/global.php | 5 +- scripts/checkout.sh | 18 --- scripts/compile_translations.sh | 31 ++--- scripts/extract_translations.sh | 23 +--- scripts/link_modules_resources.sh | 83 ++++--------- scripts/post-install.sh | 12 -- scripts/seed-db.sh | 13 +-- scripts/update-all.sh | 26 +---- scripts/upgrade-db.sh | 8 +- scripts/upgrade-url.sh | 1 - vagrant/bootstrap.sh | 49 ++------ 17 files changed, 165 insertions(+), 326 deletions(-) delete mode 100755 scripts/checkout.sh delete mode 100755 scripts/post-install.sh diff --git a/.gitignore b/.gitignore index 2602994..c374c9c 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ public/js/ public/img/ public/flags/ public/views/ +scripts/public module/ npm-debug.log node_modules/ diff --git a/INSTALL/INSTALL.rhel7.md b/INSTALL/INSTALL.rhel7.md index db041f4..634aed4 100644 --- a/INSTALL/INSTALL.rhel7.md +++ b/INSTALL/INSTALL.rhel7.md @@ -69,10 +69,10 @@ Clone the repository and invoke composer Backend - $ mkdir module - $ cd module/ - $ ln -s ./../vendor/monarc/core Monarc\Core - $ ln -s ./../vendor/monarc/frontoffice Monarc\FrontOffice + $ cd module/Monarc + $ ln -s ./../../vendor/monarc/core Core + $ ln -s ./../../vendor/monarc/frontoffice FrontOffice + $ cd ../.. Frontend @@ -128,4 +128,4 @@ Set file ownership for monarc installation Header always set X-Frame-Options SAMEORIGIN - SetEnv APPLICATION_ENV "development" + SetEnv APP_ENV "development" diff --git a/INSTALL/INSTALL.ubuntu1604.md b/INSTALL/INSTALL.ubuntu1604.md index fd87764..be30465 100644 --- a/INSTALL/INSTALL.ubuntu1604.md +++ b/INSTALL/INSTALL.ubuntu1604.md @@ -49,7 +49,7 @@ Especially by setting a strong root password. Header always set X-Frame-Options SAMEORIGIN - SetEnv APPLICATION_ENV "development" + SetEnv APP_ENV "development" @@ -88,10 +88,10 @@ You must create modules with symbolic links to libraries. Create two symbolic links: - $ mkdir module - $ cd module/ - $ ln -s ./../vendor/monarc/core Monarc/Core - $ ln -s ./../vendor/monarc/frontoffice Monarc/FrontOffice + $ cd module/Monarc + $ ln -s ./../../vendor/monarc/core Core + $ ln -s ./../../vendor/monarc/frontoffice FrontOffice + $ cd ../.. There are 2 parts: diff --git a/INSTALL/INSTALL.ubuntu1804.md b/INSTALL/INSTALL.ubuntu1804.md index 81a61ac..4a46ea7 100644 --- a/INSTALL/INSTALL.ubuntu1804.md +++ b/INSTALL/INSTALL.ubuntu1804.md @@ -50,7 +50,7 @@ Especially by setting a strong root password. Header always set X-Frame-Options SAMEORIGIN - SetEnv APPLICATION_ENV "development" + SetEnv APP_ENV "development" @@ -84,10 +84,10 @@ The back-end is using the Zend Framework 3. Create two symbolic links: - $ mkdir module - $ cd module/ - $ ln -s ./../vendor/monarc/core Monarc/Core - $ ln -s ./../vendor/monarc/frontoffice Monarc/FrontOffice + $ cd module/Monarc + $ ln -s ./../../vendor/monarc/core Core + $ ln -s ./../../vendor/monarc/frontoffice FrontOffice + $ cd ../.. There are 2 parts: diff --git a/composer.json b/composer.json index fe7379c..9d3cd4b 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,6 @@ "monarc/core": "dev-feature/upgrade-to-zf3", "monarc/frontoffice": "dev-feature/upgrade-to-zf3", "monarc/phpword": "dev-master", - "zendframework/zend-component-installer": "^2.1", "zendframework/zend-mvc": "^3.1", "zendframework/zend-di": "^3.1", "zendframework/zend-permissions-rbac": "^3.0", @@ -26,7 +25,8 @@ "zendframework/zend-i18n": "^2.9" }, "require-dev": { - "roave/security-advisories": "dev-master" + "roave/security-advisories": "dev-master", + "zendframework/zend-component-installer": "^2.1" }, "config": { "bin-dir": "bin/" diff --git a/composer.lock b/composer.lock index a8b21aa..47bfb7c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "067fa4026b84e73549b355eab7b79e8c", + "content-hash": "9b89601d661994ac8c683fe67996c859", "packages": [ { "name": "cakephp/cache", @@ -443,16 +443,16 @@ }, { "name": "doctrine/cache", - "version": "v1.8.0", + "version": "v1.8.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57" + "reference": "d4374ae95b36062d02ef310100ed33d78738d76c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/d768d58baee9a4862ca783840eca1b9add7a7f57", - "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57", + "url": "https://api.github.com/repos/doctrine/cache/zipball/d4374ae95b36062d02ef310100ed33d78738d76c", + "reference": "d4374ae95b36062d02ef310100ed33d78738d76c", "shasum": "" }, "require": { @@ -487,6 +487,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -495,10 +499,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -514,7 +514,7 @@ "cache", "caching" ], - "time": "2018-08-21T18:01:43+00:00" + "time": "2019-10-28T09:31:32+00:00" }, { "name": "doctrine/collections", @@ -1448,12 +1448,12 @@ "source": { "type": "git", "url": "https://github.com/monarc-project/zm-core.git", - "reference": "d0f105d87a0833aa1a89e934815b7717c74c95e7" + "reference": "ff88326a7365bbb952ce7f90454938a727d6276e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/monarc-project/zm-core/zipball/d0f105d87a0833aa1a89e934815b7717c74c95e7", - "reference": "d0f105d87a0833aa1a89e934815b7717c74c95e7", + "url": "https://api.github.com/repos/monarc-project/zm-core/zipball/ff88326a7365bbb952ce7f90454938a727d6276e", + "reference": "ff88326a7365bbb952ce7f90454938a727d6276e", "shasum": "" }, "require": { @@ -1519,7 +1519,7 @@ } ], "description": "Core for monarc/monarc application", - "time": "2019-10-17T14:21:57+00:00" + "time": "2019-10-28T12:21:56+00:00" }, { "name": "monarc/frontoffice", @@ -1527,12 +1527,12 @@ "source": { "type": "git", "url": "https://github.com/monarc-project/zm-client.git", - "reference": "87fa5f87b5215ce13e41b1f9ba6e61fb2875490a" + "reference": "d9bd6e39f02d0238712502e9e81337b6e659d369" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/monarc-project/zm-client/zipball/87fa5f87b5215ce13e41b1f9ba6e61fb2875490a", - "reference": "87fa5f87b5215ce13e41b1f9ba6e61fb2875490a", + "url": "https://api.github.com/repos/monarc-project/zm-client/zipball/d9bd6e39f02d0238712502e9e81337b6e659d369", + "reference": "d9bd6e39f02d0238712502e9e81337b6e659d369", "shasum": "" }, "require": { @@ -1577,7 +1577,7 @@ } ], "description": "Frontoffice for monarc/monarc application", - "time": "2019-10-18T06:00:52+00:00" + "time": "2019-10-28T10:33:23+00:00" }, { "name": "monarc/phpword", @@ -2036,16 +2036,16 @@ }, { "name": "psr/log", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2", + "reference": "bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2", "shasum": "" }, "require": { @@ -2054,7 +2054,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -2079,7 +2079,7 @@ "psr", "psr-3" ], - "time": "2018-11-20T15:27:04+00:00" + "time": "2019-10-25T08:06:51+00:00" }, { "name": "psr/simple-cache", @@ -3070,58 +3070,6 @@ ], "time": "2019-10-05T23:18:22+00:00" }, - { - "name": "zendframework/zend-component-installer", - "version": "2.1.2", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-component-installer.git", - "reference": "56871c43e40f92324b25d5a4d50ff51f9f556910" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-component-installer/zipball/56871c43e40f92324b25d5a4d50ff51f9f556910", - "reference": "56871c43e40f92324b25d5a4d50ff51f9f556910", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0", - "php": "^7.1" - }, - "require-dev": { - "composer/composer": "^1.5.2", - "malukenho/docheader": "^0.1.6", - "mikey179/vfsstream": "^1.6.7", - "phpunit/phpunit": "^7.5.15 || ^8.3.4", - "zendframework/zend-coding-standard": "~1.0.0" - }, - "type": "composer-plugin", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev", - "dev-develop": "2.2.x-dev" - }, - "class": "Zend\\ComponentInstaller\\ComponentInstaller" - }, - "autoload": { - "psr-4": { - "Zend\\ComponentInstaller\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Composer plugin for injecting modules and configuration providers into application configuration", - "keywords": [ - "ZendFramework", - "component installer", - "composer", - "plugin", - "zf" - ], - "time": "2019-09-04T19:10:43+00:00" - }, { "name": "zendframework/zend-config", "version": "3.3.0", @@ -4058,16 +4006,16 @@ }, { "name": "zendframework/zend-modulemanager", - "version": "2.8.2", + "version": "2.8.4", "source": { "type": "git", "url": "https://github.com/zendframework/zend-modulemanager.git", - "reference": "394df6e12248ac430a312d4693f793ee7120baa6" + "reference": "b2596d24b9a4e36a3cd114d35d3ad0918db9a243" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-modulemanager/zipball/394df6e12248ac430a312d4693f793ee7120baa6", - "reference": "394df6e12248ac430a312d4693f793ee7120baa6", + "url": "https://api.github.com/repos/zendframework/zend-modulemanager/zipball/b2596d24b9a4e36a3cd114d35d3ad0918db9a243", + "reference": "b2596d24b9a4e36a3cd114d35d3ad0918db9a243", "shasum": "" }, "require": { @@ -4077,7 +4025,7 @@ "zendframework/zend-stdlib": "^3.1 || ^2.7" }, "require-dev": { - "phpunit/phpunit": "^6.0.8 || ^5.7.15", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.16", "zendframework/zend-coding-standard": "~1.0.0", "zendframework/zend-console": "^2.6", "zendframework/zend-di": "^2.6", @@ -4094,8 +4042,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev", - "dev-develop": "2.8-dev" + "dev-master": "2.8.x-dev", + "dev-develop": "2.9.x-dev" } }, "autoload": { @@ -4108,13 +4056,12 @@ "BSD-3-Clause" ], "description": "Modular application system for zend-mvc applications", - "homepage": "https://github.com/zendframework/zend-modulemanager", "keywords": [ "ZendFramework", "modulemanager", "zf" ], - "time": "2017-12-02T06:11:18+00:00" + "time": "2019-10-28T13:29:38+00:00" }, { "name": "zendframework/zend-mvc", @@ -4639,16 +4586,16 @@ }, { "name": "zendframework/zend-validator", - "version": "2.12.1", + "version": "2.12.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-validator.git", - "reference": "7b870a7515f3a35afbecc39d63f34a861f40f58b" + "reference": "fd24920c2afcf2a70d11f67c3457f8f509453a62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/7b870a7515f3a35afbecc39d63f34a861f40f58b", - "reference": "7b870a7515f3a35afbecc39d63f34a861f40f58b", + "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/fd24920c2afcf2a70d11f67c3457f8f509453a62", + "reference": "fd24920c2afcf2a70d11f67c3457f8f509453a62", "shasum": "" }, "require": { @@ -4708,7 +4655,7 @@ "validator", "zf" ], - "time": "2019-10-12T12:17:57+00:00" + "time": "2019-10-29T08:33:25+00:00" }, { "name": "zendframework/zend-view", @@ -4805,12 +4752,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "eb59d9f35a47f567ae15e7179d7c666489cd4b85" + "reference": "f8c8349a4b12a26edfa8b21d07d3dbeb6dcedcfa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/eb59d9f35a47f567ae15e7179d7c666489cd4b85", - "reference": "eb59d9f35a47f567ae15e7179d7c666489cd4b85", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/f8c8349a4b12a26edfa8b21d07d3dbeb6dcedcfa", + "reference": "f8c8349a4b12a26edfa8b21d07d3dbeb6dcedcfa", "shasum": "" }, "conflict": { @@ -5013,7 +4960,59 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2019-10-09T14:04:58+00:00" + "time": "2019-10-29T22:11:03+00:00" + }, + { + "name": "zendframework/zend-component-installer", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-component-installer.git", + "reference": "56871c43e40f92324b25d5a4d50ff51f9f556910" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-component-installer/zipball/56871c43e40f92324b25d5a4d50ff51f9f556910", + "reference": "56871c43e40f92324b25d5a4d50ff51f9f556910", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": "^7.1" + }, + "require-dev": { + "composer/composer": "^1.5.2", + "malukenho/docheader": "^0.1.6", + "mikey179/vfsstream": "^1.6.7", + "phpunit/phpunit": "^7.5.15 || ^8.3.4", + "zendframework/zend-coding-standard": "~1.0.0" + }, + "type": "composer-plugin", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev", + "dev-develop": "2.2.x-dev" + }, + "class": "Zend\\ComponentInstaller\\ComponentInstaller" + }, + "autoload": { + "psr-4": { + "Zend\\ComponentInstaller\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Composer plugin for injecting modules and configuration providers into application configuration", + "keywords": [ + "ZendFramework", + "component installer", + "composer", + "plugin", + "zf" + ], + "time": "2019-09-04T19:10:43+00:00" } ], "aliases": [], diff --git a/config/autoload/global.php b/config/autoload/global.php index d9384be..f984c3d 100644 --- a/config/autoload/global.php +++ b/config/autoload/global.php @@ -11,6 +11,7 @@ * file. */ +use Doctrine\DBAL\Driver\PDOMySql\Driver; use Monarc\Core\Service\DoctrineCacheServiceFactory; use Monarc\Core\Service\DoctrineLoggerFactory; @@ -32,7 +33,7 @@ return array( 'doctrine' => array( 'connection' => array( 'orm_default' => array( - 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', + 'driverClass' => Driver::class, 'params' => array( 'host' => 'localhost', 'port' => 3306, @@ -48,7 +49,7 @@ return array( ), ), 'orm_cli' => array( - 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', + 'driverClass' => Driver::class, 'params' => array( 'host' => 'localhost', 'port' => 3306, diff --git a/scripts/checkout.sh b/scripts/checkout.sh deleted file mode 100755 index ed76fdc..0000000 --- a/scripts/checkout.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -checkout_if_exists() { - if [ -d $1 ]; then - pushd $1 >/dev/null - git checkout $2 - popd >/dev/null - fi -} - - -checkout_if_exists . $1 -checkout_if_exists module/Monarc/Core $1 -checkout_if_exists module/Monarc/BackOffice $1 -checkout_if_exists module/Monarc/FrontOffice $1 -checkout_if_exists node_modules/ng_backoffice $1 -checkout_if_exists node_modules/ng_client $1 -checkout_if_exists node_modules/ng_anr $1 diff --git a/scripts/compile_translations.sh b/scripts/compile_translations.sh index ef4b37f..aab4d77 100755 --- a/scripts/compile_translations.sh +++ b/scripts/compile_translations.sh @@ -1,27 +1,12 @@ #!/bin/bash -if [ -d node_modules/ng_backoffice ]; then - pushd node_modules/ng_backoffice - grunt compile_translations - grunt concat +pushd node_modules/ng_client +grunt compile_translations +grunt concat - if [ -d po ]; then - for i in $(ls po/*\.po); do - l=$(basename $i .po) - msgfmt -o ./po/$l.mo -v ./po/$l.po - done; - fi -fi - -if [ -d node_modules/ng_client ]; then - pushd node_modules/ng_client - grunt compile_translations - grunt concat - - if [ -d po ]; then - for i in $(ls po/*\.po); do - l=$(basename $i .po) - msgfmt -o ./po/$l.mo -v ./po/$l.po - done; - fi +if [ -d po ]; then + for i in $(ls po/*\.po); do + l=$(basename $i .po) + msgfmt -o ./po/$l.mo -v ./po/$l.po + done; fi diff --git a/scripts/extract_translations.sh b/scripts/extract_translations.sh index b3949f3..db5d757 100755 --- a/scripts/extract_translations.sh +++ b/scripts/extract_translations.sh @@ -1,22 +1,9 @@ #!/bin/bash -if [ -d node_modules/ng_backoffice ]; then - pushd node_modules/ng_backoffice +pushd node_modules/ng_client - if [ -f node_modules/.bin/grunt ]; then - node_modules/.bin/grunt extract_translations - else - grunt extract_translations - fi -fi - - -if [ -d node_modules/ng_client ]; then - pushd node_modules/ng_client - - if [ -f node_modules/.bin/grunt ]; then - node_modules/.bin/grunt extract_translations - else - grunt extract_translations - fi +if [ -f node_modules/.bin/grunt ]; then + node_modules/.bin/grunt extract_translations +else + grunt extract_translations fi diff --git a/scripts/link_modules_resources.sh b/scripts/link_modules_resources.sh index d2aabdb..93e9832 100755 --- a/scripts/link_modules_resources.sh +++ b/scripts/link_modules_resources.sh @@ -37,68 +37,31 @@ else find -L public/img -type l -exec rm {} \; fi -# Link modules resources -if [ -d node_modules/ng_backoffice ]; then - cd public/views/ && find ../../node_modules/ng_backoffice/views -maxdepth 1 -name "*.html" -exec ln -s {} \; 2>/dev/null - cd dialogs/ && find ../../../node_modules/ng_backoffice/views/dialogs -maxdepth 1 -name "*.html" -exec ln -s {} \; 2>/dev/null - cd ../partials/ && find ../../../node_modules/ng_backoffice/views/partials -maxdepth 1 -name "*.html" -exec ln -s {} \; 2>/dev/null - cd ../../js/ && find ../../node_modules/ng_backoffice/src -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null - cd ../css/ && find ../../node_modules/ng_backoffice/css -name "*" -exec ln -s {} \; 2>/dev/null - cd ../img/ && find ../../node_modules/ng_backoffice/img -name "*" -exec ln -s {} \; 2>/dev/null - cd ../flags/ && find ../../node_modules/ng_backoffice/node_modules/ng-country-flags/dist/flags -mindepth 1 -type d -exec ln -s {} \; 2>/dev/null +# Link modules resources. TODO: Replace with Grunt tasks to minify the JS and CSS. +cd public/views/ && find ../../node_modules/ng_client/views -name "*.html" -exec ln -s {} \; 2>/dev/null +cd dialogs/ && find ../../../node_modules/ng_client/views/dialogs -maxdepth 1 -name "*.html" -exec ln -s {} \; 2>/dev/null +cd ../../js/ && find ../../node_modules/ng_client/src -name "*" -exec ln -s {} \; 2>/dev/null +cd ../css/ && find ../../node_modules/ng_client/css -name "*" -exec ln -s {} \; 2>/dev/null +cd ../img/ && find ../../node_modules/ng_client/img -name "*" -exec ln -s {} \; 2>/dev/null +cd ../flags/ && find ../../node_modules/ng_client/node_modules/ng-country-flags/dist/flags -mindepth 1 -type d -exec ln -s {} \; 2>/dev/null - if [ -d ../../node_modules/ng_anr ]; then - cd ../js/ - mkdir -p anr - cd anr && find ../../../node_modules/ng_anr/src -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null - cd .. +cd ../js/ +mkdir -p anr +cd anr && find ../../../node_modules/ng_anr/src -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null +cd .. - cd ../views/ - mkdir -p anr - cd anr && find ../../../node_modules/ng_anr/views -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null - cd .. +cd ../views/ +mkdir -p anr +cd anr && find ../../../node_modules/ng_anr/views -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null +cd .. - cd ../css/ - mkdir -p anr - cd anr && find ../../../node_modules/ng_anr/css -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null - cd .. - fi +cd ../css/ +mkdir -p anr +cd anr && find ../../../node_modules/ng_anr/css -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null +cd .. - cd ../.. +cd ../.. - pushd node_modules/ng_backoffice - grunt concat - popd -fi - -if [ -d node_modules/ng_client ]; then - cd public/views/ && find ../../node_modules/ng_client/views -name "*.html" -exec ln -s {} \; 2>/dev/null - cd dialogs/ && find ../../../node_modules/ng_client/views/dialogs -maxdepth 1 -name "*.html" -exec ln -s {} \; 2>/dev/null - cd ../../js/ && find ../../node_modules/ng_client/src -name "*" -exec ln -s {} \; 2>/dev/null - cd ../css/ && find ../../node_modules/ng_client/css -name "*" -exec ln -s {} \; 2>/dev/null - cd ../img/ && find ../../node_modules/ng_client/img -name "*" -exec ln -s {} \; 2>/dev/null - cd ../flags/ && find ../../node_modules/ng_client/node_modules/ng-country-flags/dist/flags -mindepth 1 -type d -exec ln -s {} \; 2>/dev/null - - if [ -d ../../node_modules/ng_anr ]; then - cd ../js/ - mkdir -p anr - cd anr && find ../../../node_modules/ng_anr/src -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null - cd .. - - cd ../views/ - mkdir -p anr - cd anr && find ../../../node_modules/ng_anr/views -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null - cd .. - - cd ../css/ - mkdir -p anr - cd anr && find ../../../node_modules/ng_anr/css -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null - cd .. - fi - - cd ../.. - - pushd node_modules/ng_client - grunt concat - popd -fi +pushd node_modules/ng_client +grunt concat +popd diff --git a/scripts/post-install.sh b/scripts/post-install.sh deleted file mode 100755 index c2eca07..0000000 --- a/scripts/post-install.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -npm install - -cd node_modules/ng_backoffice -npm install - -cd ../.. - -# Compile stuff needed for the minified frontend -./scripts/compile_translations.sh -./scripts/link_modules_resources.sh \ No newline at end of file diff --git a/scripts/seed-db.sh b/scripts/seed-db.sh index 4500a20..29ae7dd 100755 --- a/scripts/seed-db.sh +++ b/scripts/seed-db.sh @@ -1,14 +1,5 @@ #!/bin/bash -if [ -d module/Monarc/Core ]; then - php ./vendor/robmorgan/phinx/bin/phinx seed:run -c ./module/Monarc/Core/migrations/phinx.php -fi - -if [ -d module/Monarc/BackOffice ]; then - php ./vendor/robmorgan/phinx/bin/phinx seed:run -c ./module/Monarc/BackOffice/migrations/phinx.php -fi - -if [ -d module/Monarc/FrontOffice ]; then - php ./vendor/robmorgan/phinx/bin/phinx seed:run -c ./module/Monarc/FrontOffice/migrations/phinx.php -fi +php ./vendor/robmorgan/phinx/bin/phinx seed:run -c ./module/Monarc/Core/migrations/phinx.php +php ./vendor/robmorgan/phinx/bin/phinx seed:run -c ./module/Monarc/FrontOffice/migrations/phinx.php diff --git a/scripts/update-all.sh b/scripts/update-all.sh index 13db84c..8addf4a 100755 --- a/scripts/update-all.sh +++ b/scripts/update-all.sh @@ -108,18 +108,6 @@ else pathFO="vendor/monarc/frontoffice" fi -if [[ -d node_modules && -d node_modules/ng_anr ]]; then - if [[ -d node_modules/ng_anr/.git ]]; then - pull_if_exists node_modules/ng_backoffice - pull_if_exists node_modules/ng_client - pull_if_exists node_modules/ng_anr - else - npm update - fi -else - npm install -fi - if [[ $bypass -eq 0 ]]; then if [ -e data/backup/credentialsmysql.cnf ]; then backupdir=data/backup/$(date +"%Y%m%d_%H%M%S") @@ -136,17 +124,9 @@ if [[ $bypass -eq 0 ]]; then migrate_module $phpcommand $pathFO fi -if [ -d node_modules/ng_backoffice ]; then - cd node_modules/ng_backoffice - npm install - cd ../.. -fi - -if [ -d node_modules/ng_client ]; then - cd node_modules/ng_client - npm install - cd ../.. -fi +cd node_modules/ng_client +npm install +cd ../.. ./scripts/link_modules_resources.sh ./scripts/compile_translations.sh diff --git a/scripts/upgrade-db.sh b/scripts/upgrade-db.sh index fbafbdf..370b771 100755 --- a/scripts/upgrade-db.sh +++ b/scripts/upgrade-db.sh @@ -2,10 +2,4 @@ php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./module/Monarc/Core/migrations/phinx.php -if [ -d module/Monarc/BackOffice ]; then - php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./module/Monarc/BackOffice/migrations/phinx.php -fi - -if [ -d module/Monarc/FrontOffice ]; then - php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./module/Monarc/FrontOffice/migrations/phinx.php -fi +php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./module/Monarc/FrontOffice/migrations/phinx.php diff --git a/scripts/upgrade-url.sh b/scripts/upgrade-url.sh index ded8545..e9b9f5a 100755 --- a/scripts/upgrade-url.sh +++ b/scripts/upgrade-url.sh @@ -14,6 +14,5 @@ oldurl_if_exists . $1 oldurl_if_exists module/Monarc/Core $1 oldurl_if_exists module/Monarc/BackOffice $1 oldurl_if_exists module/Monarc/FrontOffice $1 -oldurl_if_exists node_modules/ng_backoffice $1 oldurl_if_exists node_modules/ng_client $1 oldurl_if_exists node_modules/ng_anr $1 diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index 35c517b..4ab9a1b 100644 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -1,9 +1,9 @@ #! /usr/bin/env bash -TAG='' - PATH_TO_MONARC='/home/ubuntu/monarc' -ENVIRONMENT='DEVELOPMENT' + +APPENV='local' +ENVIRONMENT='development' DBHOST='localhost' DBNAME_COMMON='monarc_common' @@ -30,8 +30,6 @@ locale-gen en_US.UTF-8 dpkg-reconfigure locales - - echo -e "\n--- Installing now… ---\n" echo -e "\n--- Updating packages list… ---\n" @@ -41,11 +39,7 @@ echo -e "\n--- Install base packages… ---\n" apt-get -y install vim zip unzip git gettext curl gsfonts > /dev/null - - echo -e "\n--- Install MariaDB specific packages and settings… ---\n" -# echo "mysql-server mysql-server/root_password password $DBPASSWORD_ADMIN" | debconf-set-selections -# echo "mysql-server mysql-server/root_password_again password $DBPASSWORD_ADMIN" | debconf-set-selections apt-get -y install mariadb-server mariadb-client > /dev/null # Secure the MariaDB installation (especially by setting a strong root password) systemctl restart mariadb.service > /dev/null @@ -83,9 +77,7 @@ echo -e "\n--- Setting up our MariaDB user for MONARC… ---\n" mysql -u root -p$DBPASSWORD_ADMIN -e "CREATE USER '$DBUSER_MONARC'@'%' IDENTIFIED BY '$DBPASSWORD_MONARC';" mysql -u root -p$DBPASSWORD_ADMIN -e "GRANT ALL PRIVILEGES ON * . * TO '$DBUSER_MONARC'@'%';" mysql -u root -p$DBPASSWORD_ADMIN -e "FLUSH PRIVILEGES;" - - - +systemctl restart mariadb.service > /dev/null echo -e "\n--- Installing PHP-specific packages… ---\n" apt-get -y install php apache2 libapache2-mod-php php-curl php-gd php-mysql php-pear php-apcu php-xml php-mbstring php-intl php-imagick php-zip php-xdebug > /dev/null @@ -111,12 +103,6 @@ a2enmod headers > /dev/null 2>&1 echo -e "\n--- Allowing Apache override to all ---\n" sudo sed -i "s/AllowOverride None/AllowOverride All/g" /etc/apache2/apache2.conf -#echo -e "\n--- We want to see the PHP errors, turning them on ---\n" -#sed -i "s/.*error_reporting.*/error_reporting = E_ALL/g" $PHP_INI -#sed -i "s/.*display_errors.*/display_errors = On/g" $PHP_INI - - - echo -e "\n--- Installing composer… ---\n" curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer > /dev/null 2>&1 @@ -126,37 +112,20 @@ if [ $? -ne 0 ]; then fi composer self-update - - - echo -e "\n--- Installing MONARC… ---\n" cd $PATH_TO_MONARC git config core.fileMode false -if [ "$TAG" != '' ]; then - # Checkout the latest tag - #latestTag=$(git describe --tags `git rev-list --tags --max-count=1`) - git checkout $TAG -fi -echo -e "\n--- Retrieving MONARC libraries… ---\n" -# TODO: Can be removed when we move to packagis. +echo -e "\n--- Installing the dependencies… ---\n" composer install -o -# Back-end -mkdir -p module/Monarc/Proxy + +# Make modules symlinks. cd module/Monarc ln -s ./../../vendor/monarc/core Core ln -s ./../../vendor/monarc/frontoffice FrontOffice cd $PATH_TO_MONARC -# cd module/Monarc/FrontOffice -# git config core.fileMode false -# cd $PATH_TO_MONARC -# cd module/Monarc/Core -# git config core.fileMode false -# cd $PATH_TO_MONARC -mkdir -p data/cache -mkdir -p data/LazyServices/Proxy # Front-end mkdir node_modules @@ -197,7 +166,7 @@ cat > /etc/apache2/sites-enabled/000-default.conf < - SetEnv APPLICATION_ENV $ENVIRONMENT + SetEnv APP_ENV $ENVIRONMENT SetEnv APP_DIR $PATH_TO_MONARC EOF @@ -207,7 +176,7 @@ systemctl restart apache2.service > /dev/null -echo -e "\n--- Configuration of MONARC data base connection ---\n" +echo -e "\n--- Configuration of MONARC database connection ---\n" cat > config/autoload/local.php <