diff --git a/build.properties b/build.properties new file mode 100644 index 0000000..2016378 --- /dev/null +++ b/build.properties @@ -0,0 +1,12 @@ +version=0.1.0 +author.name=Pascal Paulis +author.email=pascal.paulis@continuousphp.com + +db.host=localhost +db.name=monarc +db.username=dbuser +db.password=123 + +dir.bin=./bin + +phinx.bin=${dir.bin}/phinx \ No newline at end of file diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..901b16c --- /dev/null +++ b/build.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DROP DATABASE IF EXISTS `${db.name}`; + + + + + + + + + + CREATE DATABASE IF NOT EXISTS ${db.name}; + GRANT USAGE ON *.* TO '${db.username}'@'%' IDENTIFIED BY '${db.password}'; + GRANT UPDATE,CREATE,REFERENCES,ALTER,LOCK TABLES,CREATE VIEW,CREATE + ROUTINE,TRIGGER,INSERT,DELETE,DROP,INDEX,CREATE TEMPORARY TABLES,EXECUTE,SHOW VIEW,ALTER ROUTINE,SELECT ON + `${db.name}`.* TO '${db.username}'@'%'; + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/composer.json b/composer.json index 865f6ce..42f7f30 100644 --- a/composer.json +++ b/composer.json @@ -12,9 +12,22 @@ "php": ">=5.5", "zendframework/zendframework": "2.5.3", "doctrine/doctrine-orm-module": "^0.10", - "robmorgan/phinx": "0.5.*" + "robmorgan/phinx": "0.5.*", + "monarc/core": "dev-beta", + "monarc/backoffice": "dev-beta", + "phing/phing": "~2.0" }, "config": { "bin-dir": "bin/" - } + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/CASES-LU/zm-core" + }, + { + "type": "vcs", + "url": "https://github.com/CASES-LU/zm-backoffice" + } + ] } diff --git a/config/autoload/database.local.php.dist b/config/autoload/database.local.php.dist new file mode 100644 index 0000000..2e30aae --- /dev/null +++ b/config/autoload/database.local.php.dist @@ -0,0 +1,24 @@ + array( + 'connection' => array( + 'orm_default' => array( + 'params' => array( + 'host' => '@db.host@', + 'user' => '@db.username@', + 'password' => '@db.password@', + 'dbname' => '@db.name@', + ) + ), + 'orm_cli' => array( + 'params' => array( + 'host' => '@db.host@', + 'user' => '@db.username@', + 'password' => '@db.password@', + 'dbname' => '@db.name@', + ) + ) + ) + ) +); diff --git a/config/autoload/languages.local.php.dist b/config/autoload/languages.local.php.dist new file mode 100644 index 0000000..fbc7c8b --- /dev/null +++ b/config/autoload/languages.local.php.dist @@ -0,0 +1,30 @@ + [ + 1 => 'Français', + 2 => 'English', + 3 => 'Deutsch' + ], + + 'defaultLanguageIndex' => 1, + + /* Link with (ModuleCore) + config['languages'] = [ + 'fr' => array( + 'index' => 1, + 'label' => 'Français' + ), + 'en' => array( + 'index' => 2, + 'label' => 'English' + ), + 'de' => array( + 'index' => 3, + 'label' => 'Deutsch' + ), + ] + */ + + 'activeLanguages' => array('fr','en','de',) +); diff --git a/config/autoload/security-authentication.local.php.dist b/config/autoload/security-authentication.local.php.dist new file mode 100644 index 0000000..1213f69 --- /dev/null +++ b/config/autoload/security-authentication.local.php.dist @@ -0,0 +1,8 @@ + array( + 'ttl' => @monarc.ttl@, // timeout + 'salt' => '@monarc.salt@', // salt privé pour chiffrement pwd + ), +); diff --git a/continuous.yml b/continuous.yml new file mode 100644 index 0000000..9b5d112 --- /dev/null +++ b/continuous.yml @@ -0,0 +1,5 @@ +# continuous.yml +deployment: + hooks: + AfterInstall: + - command: scripts/migrate.sh \ No newline at end of file diff --git a/package.json b/package.json index daee00a..e2caecc 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,16 @@ "private": true, "repository": { "type": "git", - "url": "ssh://gogs@rhea.netlor.fr:2222/monarc/skeleton.git" + "url": "https://github.com/CASES-LU/skeleton.git" }, "author": "Netlor", - "license": "Copyright" -} + "license": "Copyright", + "dependencies": { + "ng_anr": "git+ssh://git@github.com/CASES-LU/ng_anr#beta", + "ng_backoffice": "git+ssh://git@github.com/CASES-LU/ng_backoffice#beta" + }, + "devDependencies": { + "grunt": "~0.4.1", + "grunt-cli": "~0.1.13" + } +} \ No newline at end of file diff --git a/package.json.continuousphp b/package.json.continuousphp new file mode 100644 index 0000000..fe78126 --- /dev/null +++ b/package.json.continuousphp @@ -0,0 +1,20 @@ +{ + "name": "MONARC", + "version": "1.0.0", + "description": "MONARC Skeleton App", + "private": true, + "repository": { + "type": "git", + "url": "https://github.com/CASES-LU/skeleton.git" + }, + "author": "Netlor", + "license": "Copyright", + "dependencies": { + "ng_anr": "git+https://@github.token@:x-oauth-basic@github.com/CASES-LU/ng-anr#beta", + "ng_backoffice": "git+https://@github.token@:x-oauth-basic@github.com/CASES-LU/ng-backoffice#beta" + }, + "devDependencies": { + "grunt": "~0.4.1", + "grunt-cli": "~0.1.13" + } +} \ No newline at end of file diff --git a/scripts/client-upgrade-db.sh b/scripts/client-upgrade-db.sh index 853e62c..88d46f4 100755 --- a/scripts/client-upgrade-db.sh +++ b/scripts/client-upgrade-db.sh @@ -13,8 +13,8 @@ cat </tmp/conf.tmp.php array( - 'migrations' => 'module/$MODULE/migrations/db', - 'seeds' => 'module/$MODULE/migrations/seeds', + 'migrations' => 'vendor/monarc/$MODULE/migrations/db', + 'seeds' => 'vendor/monarc/$MODULE/migrations/seeds', ), 'environments' => array( 'default_migration_table' => 'phinxlog', diff --git a/scripts/compile_translations.sh b/scripts/compile_translations.sh index c84ea1f..2de3e76 100755 --- a/scripts/compile_translations.sh +++ b/scripts/compile_translations.sh @@ -2,13 +2,12 @@ if [ -d node_modules/ng_backoffice ]; then pushd node_modules/ng_backoffice - grunt compile_translations - grunt concat + ../.bin/grunt compile_translations + ../.bin/grunt concat fi - if [ -d node_modules/ng_client ]; then pushd node_modules/ng_client - grunt compile_translations - grunt concat + ../.bin/grunt compile_translations + ../.bin/grunt concat fi diff --git a/scripts/extract_translations.sh b/scripts/extract_translations.sh index 2f435cd..6ba7dfc 100755 --- a/scripts/extract_translations.sh +++ b/scripts/extract_translations.sh @@ -2,11 +2,11 @@ if [ -d node_modules/ng_backoffice ]; then pushd node_modules/ng_backoffice - grunt extract_translations + node_modules/.bin/grunt extract_translations fi if [ -d node_modules/ng_client ]; then pushd node_modules/ng_client - grunt extract_translations + node_modules/.bin/grunt extract_translations fi diff --git a/scripts/link_modules_resources.sh b/scripts/link_modules_resources.sh index 7d17683..cfbadc4 100755 --- a/scripts/link_modules_resources.sh +++ b/scripts/link_modules_resources.sh @@ -59,7 +59,7 @@ if [ -d node_modules/ng_backoffice ]; then cd ../.. pushd node_modules/ng_backoffice - grunt concat + ../.bin/grunt concat popd fi @@ -90,7 +90,7 @@ if [ -d node_modules/ng_client ]; then cd ../.. pushd node_modules/ng_client - grunt concat + ../.bin/grunt concat popd fi diff --git a/scripts/migrate.sh b/scripts/migrate.sh new file mode 100755 index 0000000..02aa88b --- /dev/null +++ b/scripts/migrate.sh @@ -0,0 +1,10 @@ +#!/bin/bash +cd /var/www/continuousphp/current + +while [ ! -f /var/lib/continuousphp/credentials.ini ] +do + sleep 2 +done + +chown -R www-data:www-data /var/www/continuousphp/current/* +bin/phing -propertyfile /var/lib/continuousphp/credentials.ini init \ No newline at end of file diff --git a/scripts/post-install.sh b/scripts/post-install.sh new file mode 100755 index 0000000..c2eca07 --- /dev/null +++ b/scripts/post-install.sh @@ -0,0 +1,12 @@ +#!/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