diff --git a/puppet/site.pp b/puppet/site.pp index a3115ab00..522c2c190 100644 --- a/puppet/site.pp +++ b/puppet/site.pp @@ -18,7 +18,10 @@ 'unzip', 'nginx', 'mysql-client-core-5.6', + 'python-dev', 'python-software-properties', + 'python-pip', + 'libmysqlclient-dev', ] # php packages needed for server @@ -150,6 +153,14 @@ mode => '0640', } +file { '/var/www/local.openstack.org/survey_builder/code/model/extract_tags/db.ini': + ensure => present, + content => template('site/db.ini.erb'), + owner => 'vagrant', + group => 'www-data', + mode => '0640', +} + service { 'nginx': ensure => running, require => [ diff --git a/puppet/templates/db.ini.erb b/puppet/templates/db.ini.erb new file mode 100644 index 000000000..40c4f1e8c --- /dev/null +++ b/puppet/templates/db.ini.erb @@ -0,0 +1,6 @@ +[mysql] +host = localhost +db = <%= @os_db %> +user = <%= @os_db_user %> +passwd = <%= @os_db_password %> +use_unicode= True \ No newline at end of file diff --git a/scripts/postdeployment.sh b/scripts/postdeployment.sh index b040381e8..cc982f3cb 100644 --- a/scripts/postdeployment.sh +++ b/scripts/postdeployment.sh @@ -1,4 +1,6 @@ #!/bin/bash -xe +# install virtual env for python +sudo pip install virtualenv; # install node js 5.x # https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -; @@ -45,3 +47,14 @@ php -r "unlink('composer-setup.php');" mkdir -p /var/www/local.openstack.org/silverstripe-cache; php composer.phar install --ignore-platform-reqs --prefer-dist; sudo ./framework/sake installsake; + + +if [[ -d /var/www/local.openstack.org/survey_builder/code/model/extract_tags ]]; then + echo "installing python virtual env for extract tags"; + cd /var/www/local.openstack.org/survey_builder/code/model/extract_tags && virtualenv env; + source /var/www/local.openstack.org/survey_builder/code/model/extract_tags/env/bin/activate; + /var/www/local.openstack.org/survey_builder/code/model/extract_tags/env/bin/python env/bin/pip install -r requirements.txt; + chmod 770 /var/www/local.openstack.org/survey_builder/code/model/extract_tags/extract_tags_by_rake.sh + chmod 770 /var/www/local.openstack.org/survey_builder/code/model/extract_tags/extract_tags_by_kmeans.sh +fi +