add karma test configuration creation in vagrant provision and add supervisor entry to launch (open|libre)office headless
authorymh <ymh.work@gmail.com>
Fri, 07 Mar 2014 09:38:10 +0100
changeset 593 8156e6e3c503
parent 592 cd268815de68
child 595 d3e56a41369e
add karma test configuration creation in vagrant provision and add supervisor entry to launch (open|libre)office headless
dev/modules/sysconfig/manifests/deploy.pp
dev/modules/sysconfig/manifests/django_init.pp
dev/modules/sysconfig/templates/workspace.info.js.erb
--- a/dev/modules/sysconfig/manifests/deploy.pp	Fri Mar 07 09:36:04 2014 +0100
+++ b/dev/modules/sysconfig/manifests/deploy.pp	Fri Mar 07 09:38:10 2014 +0100
@@ -26,7 +26,17 @@
         command      => '/srv/comt/bin/gunicorn -b unix:/var/run/gunicorn/comt.socket cm.wsgi:app',
         user         => 'www-data',
         directory    => '/srv/comt',
-        environment  => "PYTHONPATH='/srv/comt/src',PROJECT_PATH='/srv/comt/src/cm'"
+        environment  => "PYTHONPATH='/srv/comt/src',PROJECT_PATH='/srv/comt/src/cm'",
+        require      => Class['supervisord']
+    }
+
+    supervisord::program { 'soffice' :
+        command      => '/usr/bin/soffice --headless "--accept=socket,port=2002;urp;"',
+        user         => 'vagrant',
+        directory    => '/srv/comt',
+        autostart    => false,
+        numprocs     => 1,
+        require      => Class['supervisord']
     }
 
     exec { 'reload_supervisor' :
--- a/dev/modules/sysconfig/manifests/django_init.pp	Fri Mar 07 09:36:04 2014 +0100
+++ b/dev/modules/sysconfig/manifests/django_init.pp	Fri Mar 07 09:38:10 2014 +0100
@@ -23,4 +23,15 @@
         onlyif  => "/bin/echo \"from django.contrib.auth.models import User; exit(User.objects.filter(username='${superuser_name}').count())\" | /srv/comt/bin/django shell",
        require => Exec['syncdb']
     }
+
+    file { 'karma_workspace_info':
+        ensure  => 'present',
+        path    => "/srv/comt/src/cm/scripts/test-suite/workspace.info.js",
+        replace => 'no',
+        owner   => 'vagrant',
+        group   => 'vagrant',
+        mode    => 644,
+        content => template('sysconfig/workspace.info.js.erb'),
+    }
+
 }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dev/modules/sysconfig/templates/workspace.info.js.erb	Fri Mar 07 09:38:10 2014 +0100
@@ -0,0 +1,27 @@
+
+function define (name, value) {
+    Object.defineProperty (exports, name, {
+        value:      value,
+        enumerable: true
+    }); 
+}
+
+define ("WORKSPACE_URL", 'http://<%= @ipaddress_eth1 %>/');
+define ("USER_ADMIN", '<%= @superuser_name %>');
+define ("PASS_ADMIN", '<%= @superuser_pw %>');
+
+define ("BROWSERS", ['PhantomJS']);
+
+// TODO: decide wether we should populate workspaces with standard users or
+// create them on the fly ?
+
+define ("USER_EDIT", '');
+define ("PASS_EDIT", '');
+
+define ("USER_COM", '');
+define ("PASS_COM", '');
+
+define ("USER_OBSERV", '');
+define ("PASS_OBSERV", '');
+
+