# HG changeset patch # User ymh # Date 1478783222 -3600 # Node ID 240ca282331d1630cd76a68b9dca3219005f4413 # Parent 8371c99c794733ceeb505a25d73efee0be86a64f various corrections diff -r 8371c99c7947 -r 240ca282331d .hgignore --- a/.hgignore Thu Nov 10 02:01:46 2016 +0100 +++ b/.hgignore Thu Nov 10 14:07:02 2016 +0100 @@ -54,7 +54,7 @@ ^build/\.vagrant ^build/root ^build/root_puppet -^build/dist/.*\.rpm +^build/dist/.* ^dev2/ ^common/corpus-common-addon/dist ^common/corpus-common-addon/tmp diff -r 8371c99c7947 -r 240ca282331d build/build_rpm.sh --- a/build/build_rpm.sh Thu Nov 10 02:01:46 2016 +0100 +++ b/build/build_rpm.sh Thu Nov 10 14:07:02 2016 +0100 @@ -43,6 +43,7 @@ --rpm-user apache \ --rpm-group apache \ --directories /var/www/corpusdelaparole \ + --before-install /vagrant/pre_install.sh \ --after-install /vagrant/post_install.sh \ --after-remove /vagrant/post_uninstall.sh \ --after-upgrade /vagrant/post_upgrade.sh \ diff -r 8371c99c7947 -r 240ca282331d build/post_install.sh --- a/build/post_install.sh Thu Nov 10 02:01:46 2016 +0100 +++ b/build/post_install.sh Thu Nov 10 14:07:02 2016 +0100 @@ -1,13 +1,36 @@ #!/usr/bin/env sh +if [ -x /usr/local/bin/drush ]; then + echo "Reactivate corpus module" + /usr/local/bin/drush -r /var/www/corpusdelaparole/drupal pm-enable -y corpus + echo "Clear drupal cache" + /usr/local/bin/drush -r /var/www/corpusdelaparole/drupal cc all +fi + + if [ -d /var/www/corpusdelaparole/corpus-back/ ]; then - pushd /var/www/corpusdelaparole/corpus-back/ + pushd /var/www/corpusdelaparole/corpus-back/ > /dev/null echo "Correcting file permissions for back office" chgrp -R apache storage bootstrap/cache chmod -R ug+rwx storage bootstrap/cache - popd + echo "Migrating back office database" + php artisan migrate -n --force + + echo "Optimizing framework" + php artisan optimize + php artisan config:cache + php artisan route:cache + + echo "Correcting file permissions for back office" + chgrp -R apache storage bootstrap/cache + chmod -R ug+rwx storage bootstrap/cache + + echo "Put back application in production" + php artisan up + + popd > /dev/null fi diff -r 8371c99c7947 -r 240ca282331d build/pre_upgrade.sh --- a/build/pre_upgrade.sh Thu Nov 10 02:01:46 2016 +0100 +++ b/build/pre_upgrade.sh Thu Nov 10 14:07:02 2016 +0100 @@ -1,7 +1,7 @@ #!/usr/bin/env sh PATH=/opt/remi/php56/root/usr/bin/:$PATH -if [ -d /var/www/corpusdelaparole/corpus-back/ ]; then +if [ -f /var/www/corpusdelaparole/corpus-back/artisan ]; then pushd /var/www/corpusdelaparole/corpus-back/ > /dev/null echo "Put back application in maintenance" diff -r 8371c99c7947 -r 240ca282331d cms/app-client/app/routes/tabs/chrono.js --- a/cms/app-client/app/routes/tabs/chrono.js Thu Nov 10 02:01:46 2016 +0100 +++ b/cms/app-client/app/routes/tabs/chrono.js Thu Nov 10 14:07:02 2016 +0100 @@ -7,7 +7,6 @@ filter: Ember.inject.service(), model: function() { - console.log('model chrono', this.get('filter').get('queryParamsValues')); return RSVP.hash({ range: [1948, 2015], // TODO: make it dynamic datestats: this.get('store').query('datestat', this.get('filter').get('queryParamsValues')) diff -r 8371c99c7947 -r 240ca282331d cms/app-client/app/templates/components/playlist-component.hbs --- a/cms/app-client/app/templates/components/playlist-component.hbs Thu Nov 10 02:01:46 2016 +0100 +++ b/cms/app-client/app/templates/components/playlist-component.hbs Thu Nov 10 14:07:02 2016 +0100 @@ -2,7 +2,7 @@

Résultat ({{ model.meta.total }}){{#if isLoading}}{{/if}}

@@ -17,14 +17,14 @@ {{#if (ifAnd (eq player.playing true) (eq player.item document.id))}} Pause {{else}} - Play + Lecture {{/if}}
- Share notice + Partage notice
diff -r 8371c99c7947 -r 240ca282331d dev/Vagrantfile --- a/dev/Vagrantfile Thu Nov 10 02:01:46 2016 +0100 +++ b/dev/Vagrantfile Thu Nov 10 14:07:02 2016 +0100 @@ -75,7 +75,7 @@ # vb.memory = "1024" # end config.vm.provider "virtualbox" do |v| - v.memory = 2048 + v.memory = 1536 v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] end diff -r 8371c99c7947 -r 240ca282331d dev/provisioning/custom.yaml.tmpl --- a/dev/provisioning/custom.yaml.tmpl Thu Nov 10 02:01:46 2016 +0100 +++ b/dev/provisioning/custom.yaml.tmpl Thu Nov 10 14:07:02 2016 +0100 @@ -1,6 +1,6 @@ --- # install handle -sysconfig::params::install_handle : true +sysconfig::params::install_handle : false # Serveur hostname (ex: the first ip of the server : %{ipaddress_eth0}) sysconfig::params::vhost : "int.corpusdelaparole.huma-num.fr" @@ -52,7 +52,7 @@ sysconfig::params::tomcat_open_port : false # corpus application key 32 character random string (Array.new(32){"abcdefghijklmnopqrstuvwxyz0123456789!@#\$%^&*(-_=+)".split("").sample}.join ) -sysconfig::params::corpus_app_key : +sysconfig::params::corpus_app_key : tiLahriethohd2Ceratheeb7Jai0xoog # geonames user (c.f. http://www.geonames.org/login) sysconfig::params::geonames_username : demo diff -r 8371c99c7947 -r 240ca282331d dev/provisioning/default.pp --- a/dev/provisioning/default.pp Thu Nov 10 02:01:46 2016 +0100 +++ b/dev/provisioning/default.pp Thu Nov 10 14:07:02 2016 +0100 @@ -15,14 +15,15 @@ # install apache class { 'sysconfig::apache': } -# install php -class { 'sysconfig::php': } # install handle if(hiera('sysconfig::params::install_handle', true)) { class { 'sysconfig::handle': } } +# install php +class { 'sysconfig::php': }-> + # install drupal class { 'sysconfig::drupal': } diff -r 8371c99c7947 -r 240ca282331d dev/provisioning/modules/drush/manifests/cacheclear.pp --- a/dev/provisioning/modules/drush/manifests/cacheclear.pp Thu Nov 10 02:01:46 2016 +0100 +++ b/dev/provisioning/modules/drush/manifests/cacheclear.pp Thu Nov 10 14:07:02 2016 +0100 @@ -9,6 +9,7 @@ # Clear drush cache on demand. exec { 'drush-cc-drush': command => "${drush::drush_exe_default} cc drush", + environment => ["DRUSH_PHP=${drush::drush_php}"], require => File[$drush::drush_exe_default], refreshonly => true, } diff -r 8371c99c7947 -r 240ca282331d dev/provisioning/modules/drush/manifests/init.pp --- a/dev/provisioning/modules/drush/manifests/init.pp Thu Nov 10 02:01:46 2016 +0100 +++ b/dev/provisioning/modules/drush/manifests/init.pp Thu Nov 10 14:07:02 2016 +0100 @@ -80,6 +80,11 @@ $install_base_path = '/opt/drush' $drush_exe_default = '/usr/local/bin/drush' + if($php_path) { + $drush_php = $php_path + } else { + $drush_php = "/usr/bin/php" + } class{'drush::setup': } -> class{'drush::config': } ~> diff -r 8371c99c7947 -r 240ca282331d dev/provisioning/modules/sysconfig/files/rdf4j/console_commands.txt --- a/dev/provisioning/modules/sysconfig/files/rdf4j/console_commands.txt Thu Nov 10 02:01:46 2016 +0100 +++ b/dev/provisioning/modules/sysconfig/files/rdf4j/console_commands.txt Thu Nov 10 14:07:02 2016 +0100 @@ -4,16 +4,19 @@ Corpus repo + create native corpus_raw Corpus raw repo + create native lexvo Lexvo + open lexvo load file:///tmp/lexvo/lexvo.rdf quit diff -r 8371c99c7947 -r 240ca282331d dev/provisioning/modules/sysconfig/manifests/elasticsearch.pp --- a/dev/provisioning/modules/sysconfig/manifests/elasticsearch.pp Thu Nov 10 02:01:46 2016 +0100 +++ b/dev/provisioning/modules/sysconfig/manifests/elasticsearch.pp Thu Nov 10 14:07:02 2016 +0100 @@ -8,7 +8,12 @@ exec { "systemd_restart_${es_instance}": - command => '/bin/systemctl restart elasticsearch-${es_instance}', + command => "/bin/systemctl start elasticsearch-${es_instance}", + refreshonly => true, + } + + exec { "systemd_enable_${es_instance}": + command => "/bin/systemctl enable elasticsearch-${es_instance}", refreshonly => true, } @@ -16,6 +21,7 @@ manage_repo => true, autoupgrade => true, repo_version => '5.x', + status => 'unmanaged', }-> elasticsearch::instance { $es_instance: }-> file { '$es_instance jvm.options': @@ -50,6 +56,6 @@ owner => 'root', group => 'root', mode => '0750', - notify => [Exec['systemctl-daemon-reload'], Exec["systemd_restart_${es_instance}"]] + notify => [Exec['systemctl-daemon-reload'], Exec["systemd_enable_${es_instance}"], Exec["systemd_restart_${es_instance}"]] } } diff -r 8371c99c7947 -r 240ca282331d dev/provisioning/modules/sysconfig/manifests/rdf4j.pp --- a/dev/provisioning/modules/sysconfig/manifests/rdf4j.pp Thu Nov 10 02:01:46 2016 +0100 +++ b/dev/provisioning/modules/sysconfig/manifests/rdf4j.pp Thu Nov 10 14:07:02 2016 +0100 @@ -46,6 +46,9 @@ file { "/tmp/rdf4j": ensure => directory, }-> + package { "unzip": + ensure => present + }-> archive { 'rdf4j-2.1.1': ensure => present, url => "http://www.eclipse.org/downloads/download.php?file=/rdf4j/eclipse-rdf4j-2.1.1-sdk.zip&r=1", @@ -79,7 +82,7 @@ notify => Service['tomcat'] }-> exec { "undeploy-rdf4j-tomcat": - command => "/usr/bin/rm -f /var/lib/tomcat/webapps/openrdf-*.war && /bin/sleep 10", + command => "/usr/bin/rm -f /var/lib/tomcat/webapps/{openrdf,rdf4j}-*.war && /bin/sleep 10", notify => Service['tomcat'], path => "/usr/bin:/bin" }-> diff -r 8371c99c7947 -r 240ca282331d server/src/app/Console/Commands/ImportCocoonRDF.php --- a/server/src/app/Console/Commands/ImportCocoonRDF.php Thu Nov 10 02:01:46 2016 +0100 +++ b/server/src/app/Console/Commands/ImportCocoonRDF.php Thu Nov 10 14:07:02 2016 +0100 @@ -101,7 +101,8 @@ foreach ($recs as $item) { $item->registerXPathNamespace('oai', "http://www.openarchives.org/OAI/2.0/"); - $identifier = (string) $item->xpath('/oai:record/oai:header/oai:identifier')[0]; + $identifier = (string) $item->xpath('oai:header/oai:identifier')[0]; + $docRdfUrl = Config::get('corpusparole.cocoon_rdf_base_uri').substr($identifier, strlen(Config::get('corpusparole.cocoon_doc_id_base'))); $message = "$identifier : $docRdfUrl"; if($recs->getNumRetrieved() <= $skip) {