Merge branch 'beta'

remotes/origin/master
Guillaume Lesniak 2016-10-24 10:38:22 +02:00
commit 5319d756c6
15 changed files with 268 additions and 16 deletions

12
build.properties Normal file
View File

@ -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

111
build.xml Normal file
View File

@ -0,0 +1,111 @@
<project name="MonarcAppBO" default="help" basedir=".">
<property file="./build.properties" />
<target name="help" description="List available targets">
<exec executable="vendor/bin/phing"
passthru="true">
<arg value="-l"/>
</exec>
</target>
<target name="setup-npm" description="Setup NPM config">
<move file="${project.basedir}/package.json" tofile="${project.basedir}/package.json.bak" overwrite="true"/>
<loadfile property="npm.config" file="${project.basedir}/package.json.continuousphp">
<filterchain>
<replacetokens>
<token key="github.token" value="${env.GITHUB_TOKEN}"/>
</replacetokens>
</filterchain>
</loadfile>
<echo message="${npm.config}" file="${project.basedir}/package.json"/>
</target>
<target name="post-install" description="Post install">
<exec command="scripts/post-install.sh"
passthru="true"
checkreturn="true"/>
</target>
<target name="remove-npm-config" description="Remove NPM config">
<delete file="${project.basedir}/package.json" quiet="true"/>
<move file="${project.basedir}/package.json.bak" tofile="${project.basedir}/package.json" overwrite="true"/>
</target>
<target name="setup-db" description="Setup Database Credentials">
<loadfile property="db.config" file="${project.basedir}/config/autoload/database.local.php.dist">
<filterchain>
<replacetokens>
<token key="db.host" value="${db.host}"/>
<token key="db.username" value="${db.username}"/>
<token key="db.password" value="${db.password}"/>
<token key="db.name" value="${db.name}"/>
</replacetokens>
</filterchain>
</loadfile>
<echo message="${db.config}" file="${project.basedir}/config/autoload/database.local.php"/>
</target>
<target name="setup-languages" description="Setup Languages">
<loadfile property="languages.config" file="${project.basedir}/config/autoload/languages.local.php.dist">
<!-- PLACE YOUR FILE MODIFICATIONS HERE -->
</loadfile>
<echo message="${languages.config}" file="${project.basedir}/config/autoload/languages.local.php"/>
</target>
<target name="setup-application" description="Setup Application config">
<loadfile property="app.config" file="${project.basedir}/config/application.config.php-dist-BO">
<!-- PLACE YOUR FILE MODIFICATIONS HERE -->
</loadfile>
<echo message="${app.config}" file="${project.basedir}/config/application.config.php"/>
</target>
<target name="setup-sec-auth" description="Setup Security and Authentication">
<loadfile property="sec.config" file="${project.basedir}/config/autoload/security-authentication.local.php.dist">
<filterchain>
<replacetokens>
<token key="monarc.ttl" value="${monarc.ttl}"/>
<token key="monarc.salt" value="${monarc.salt}"/>
</replacetokens>
</filterchain>
</loadfile>
<echo message="${sec.config}" file="${project.basedir}/config/autoload/security-authentication.local.php"/>
</target>
<target name="drop-db">
<echo file="${project.basedir}/drop.sql">DROP DATABASE IF EXISTS `${db.name}`;</echo>
<pdosqlexec url="mysql:host=${db.host}" userid="${db.username}" password="${db.password}">
<transaction src="${project.basedir}/drop.sql"/>
</pdosqlexec>
<delete file="${project.basedir}/drop.sql" quiet="true"/>
</target>
<target name="init-db" description="Create Database and Grants">
<echo file="${project.basedir}/create.sql">
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}'@'%';
</echo>
<pdosqlexec url="mysql:host=${db.host}" userid="${db.username}" password="${db.password}">
<transaction src="${project.basedir}/create.sql"/>
</pdosqlexec>
<delete file="${project.basedir}/create.sql" quiet="true"/>
</target>
<target name="db-migration" description="Update the database version">
<exec command="${project.basedir}/scripts/client-upgrade-db.sh backoffice ${db.host} ${db.username} ${db.password} ${db.name}" passthru="true"/>
<exec command="${project.basedir}/scripts/client-upgrade-db.sh core ${db.host} ${db.username} ${db.password} ${db.name}" passthru="true"/>
</target>
<target name="reset-db"
description="Drop database and reset data"
depends="drop-db, init-db, db-migration"/>
<target name="init"
description="Setup external dependencies and migrate data"
depends="setup-db, db-migration"/>
</project>

View File

@ -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"
}
]
}

View File

@ -0,0 +1,24 @@
<?php
return array(
'doctrine' => 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@',
)
)
)
)
);

View File

@ -0,0 +1,30 @@
<?php
return array(
'languages' => [
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',)
);

View File

@ -0,0 +1,8 @@
<?php
return array(
'monarc' => array(
'ttl' => @monarc.ttl@, // timeout
'salt' => '@monarc.salt@', // salt privé pour chiffrement pwd
),
);

5
continuous.yml Normal file
View File

@ -0,0 +1,5 @@
# continuous.yml
deployment:
hooks:
AfterInstall:
- command: scripts/migrate.sh

View File

@ -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"
}
}

View File

@ -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"
}
}

View File

@ -13,8 +13,8 @@ cat <<EOF >/tmp/conf.tmp.php
<?php
return array(
'paths' => 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',

View File

@ -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

View File

@ -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

View File

@ -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

10
scripts/migrate.sh Executable file
View File

@ -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

12
scripts/post-install.sh Executable file
View File

@ -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