Skip to content

Commit

Permalink
[smarcet]
Browse files Browse the repository at this point in the history
* update vagrant to install new python based features
  • Loading branch information
smarcet committed Aug 8, 2017
1 parent 090b677 commit b25f1e9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions puppet/site.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 => [
Expand Down
6 changes: 6 additions & 0 deletions puppet/templates/db.ini.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[mysql]
host = localhost
db = <%= @os_db %>
user = <%= @os_db_user %>
passwd = <%= @os_db_password %>
use_unicode= True
13 changes: 13 additions & 0 deletions scripts/postdeployment.sh
Original file line number Diff line number Diff line change
@@ -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 -;
Expand Down Expand Up @@ -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

0 comments on commit b25f1e9

Please sign in to comment.