Fix on nodejs default version
nodejs default version is too old so now its install n node manager to install latest one, also installing bower directly on update site/install site command Change-Id: I1a2c377db24f66a6138a07e4b2f284a02083f364
This commit is contained in:
parent
4d403d240f
commit
dbd2643937
|
@ -68,10 +68,8 @@ function site_init {
|
|||
cd $target_dir
|
||||
php artisan migrate --env=$LARAVEL_ENV
|
||||
php artisan db:seed --env=$LARAVEL_ENV
|
||||
# run bower
|
||||
if [ -f "$target_dir/bower.json" ]; then
|
||||
bower install --allow-root --config.interactive=false
|
||||
fi
|
||||
update_node
|
||||
install_bower
|
||||
# activate site
|
||||
rm -rf $SITE_ROOT/w
|
||||
ln -s $SITE_ROOT/slot0 $SITE_ROOT/w
|
||||
|
@ -118,6 +116,21 @@ function catalog_get_version {
|
|||
echo $RELEASE_DATE
|
||||
}
|
||||
|
||||
function update_node {
|
||||
npm install -g n;
|
||||
n latest;
|
||||
}
|
||||
|
||||
function install_bower {
|
||||
npm install -g bower;
|
||||
npm install -g webpack;
|
||||
cd $target_dir;
|
||||
# run bower
|
||||
if [ -f "$target_dir/bower.json" ]; then
|
||||
bower install --allow-root --config.interactive=false
|
||||
fi
|
||||
}
|
||||
|
||||
function site_update {
|
||||
if [ ! $1 ]; then
|
||||
echo "ERROR: missing site parameter"
|
||||
|
@ -178,10 +191,8 @@ function site_update {
|
|||
# populate application database
|
||||
cd $target_dir
|
||||
php artisan migrate --env=$LARAVEL_ENV
|
||||
# run bower
|
||||
if [ -f "$target_dir/bower.json" ]; then
|
||||
bower install --allow-root --config.interactive=false
|
||||
fi
|
||||
update_node
|
||||
install_bower
|
||||
# activate site
|
||||
rm -rf $SITE_ROOT/w
|
||||
ln -s $target_dir $SITE_ROOT/w
|
||||
|
|
|
@ -74,18 +74,10 @@ class openstackid (
|
|||
ensure => present,
|
||||
}
|
||||
|
||||
# install nodejs default version
|
||||
class { '::nodejs':
|
||||
}
|
||||
|
||||
# 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 => Class['::nodejs'],
|
||||
}
|
||||
|
||||
group { 'openstackid':
|
||||
ensure => present,
|
||||
}
|
||||
|
@ -259,7 +251,8 @@ class openstackid (
|
|||
File['/etc/openstackid/app.php'],
|
||||
Package['curl'],
|
||||
Package[$php5_packages] ,
|
||||
Exec['install-bower'] ],
|
||||
Class['::nodejs'],
|
||||
],
|
||||
}
|
||||
|
||||
exec { 'update-site':
|
||||
|
@ -277,7 +270,8 @@ class openstackid (
|
|||
File['/etc/openstackid/environment.php'],
|
||||
File['/etc/openstackid/server.php'],
|
||||
Package[$php5_packages] ,
|
||||
Exec['install-bower'] ],
|
||||
Class['::nodejs'],
|
||||
],
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue