Added bower support

added bower installation procedure to remove bower hardcoded
dependencies on https://review.openstack.org/#/c/198458/

Change-Id: Ic0a9b3a2dcfd84df35490fcd20c8399b3e0fd3cc
This commit is contained in:
Sebastian Marcet 2015-09-22 12:36:53 -03:00
parent c8e7064575
commit dfb6169d47
2 changed files with 49 additions and 2 deletions

View File

@ -68,6 +68,10 @@ function site_init {
cd $target_dir
php artisan migrate --env=$LARAVEL_ENV
php artisan db:seed --env=$LARAVEL_ENV
# run bower
if [ -f "bower.json' ]; then
bower install --config.interactive=false
fi
# activate site
rm -rf $SITE_ROOT/w
ln -s $SITE_ROOT/slot0 $SITE_ROOT/w
@ -174,6 +178,10 @@ function site_update {
# populate application database
cd $target_dir
php artisan migrate --env=$LARAVEL_ENV
# run bower
if [ -f "bower.json' ]; then
bower install --config.interactive=false
fi
# activate site
rm -rf $SITE_ROOT/w
ln -s $target_dir $SITE_ROOT/w

View File

@ -74,6 +74,43 @@ class openstackid (
ensure => present,
}
# add node js and npm for bower installation
package { 'nodejs':
ensure => present,
}
package { 'npm':
ensure => present,
require => Package['nodejs','curl'],
}
# install node version manager (https://www.npmjs.com/package/n)
exec { 'install-node-version-manager':
cwd => '/',
path => '/usr/bin:/bin:/usr/local/bin:/usr/lib/node_modules/npm/bin',
logoutput => on_failure,
command => 'npm install -g n',
require => Package['npm'],
}
# install latest node js version
exec { 'install-latest-nodejs':
cwd => '/',
path => '/usr/bin:/bin:/usr/local/bin:/usr/lib/node_modules/npm/bin',
logoutput => on_failure,
command => 'n stable',
require => Package['npm'],
}
# install bower
exec { 'install-bower':
cwd => '/',
path => '/usr/bin:/bin:/usr/local/bin:/usr/lib/node_modules/npm/bin',
logoutput => on_failure,
command => 'npm install -g bower',
require => Package['npm'],
}
group { 'openstackid':
ensure => present,
}
@ -246,7 +283,8 @@ class openstackid (
File['/etc/openstackid/server.php'],
File['/etc/openstackid/app.php'],
Package['curl'],
Package[$php5_packages] ],
Package[$php5_packages] ,
Exec['install-bower'] ],
}
exec { 'update-site':
@ -263,7 +301,8 @@ class openstackid (
File['/etc/openstackid/log.php'],
File['/etc/openstackid/environment.php'],
File['/etc/openstackid/server.php'],
Package[$php5_packages] ],
Package[$php5_packages] ,
Exec['install-bower'] ],
}
}