From 89674a7145cd294529c911ca09a5e5692f3403d1 Mon Sep 17 00:00:00 2001 From: Sebastian Marcet Date: Mon, 11 Feb 2019 11:31:12 -0300 Subject: [PATCH] Updated deploy functions * removed installation of n package ( not needed any more due that we are installing latest nodejs version) * added sudo to npm install due lack of permissions on local node_modules * added code to ensure correct tree structure of storage folder Change-Id: I66c8a3f52d05a74b4ed190710739c75ed05b6d05 --- files/functions | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/files/functions b/files/functions index f36c0a8..356ea1a 100644 --- a/files/functions +++ b/files/functions @@ -53,8 +53,23 @@ function site_init { # link configuration files managed by puppet ln -sf /etc/openstackid/.env $target_dir/.env + # convert app/storage into symlink and set permissions mv $target_dir/storage $SITE_ROOT/ + # check for new storage structure ( LV 5.x) + if [[ ! -d $SITE_ROOT/storage/framework ]]; then + mkdir -p $SITE_ROOT/storage/framework; + mkdir -p $SITE_ROOT/storage/framework/cache; + mkdir -p $SITE_ROOT/storage/framework/views; + mkdir -p $SITE_ROOT/storage/framework/sessions; + fi + if [[ ! -d $SITE_ROOT/storage/app ]]; then + mkdir -p $SITE_ROOT/storage/app; + mkdir -p $SITE_ROOT/storage/app/public; + fi + if [[ ! -d $SITE_ROOT/storage/logs ]]; then + mkdir -p $SITE_ROOT/storage/logs; + fi chmod 02770 $SITE_ROOT/storage find $SITE_ROOT/storage/ -type d -exec chmod 0775 {} \; find $SITE_ROOT/storage/ -type f -exec chmod 0664 {} \; @@ -68,9 +83,8 @@ function site_init { php artisan db:seed --env=$LARAVEL_ENV --force fi - update_node - npm install - npm run build + sudo npm install + sudo npm run build # activate site rm -rf $SITE_ROOT/w ln -s $SITE_ROOT/slot0 $SITE_ROOT/w @@ -117,10 +131,6 @@ function catalog_get_version { echo $RELEASE_DATE } -function update_node { - npm install -g n; - n latest; -} function site_update { if [ ! $1 ]; then @@ -186,6 +196,9 @@ function site_update { mkdir -p $SITE_ROOT/storage/app; mkdir -p $SITE_ROOT/storage/app/public; fi + if [[ ! -d $SITE_ROOT/storage/logs ]]; then + mkdir -p $SITE_ROOT/storage/logs; + fi # set permissions chmod 02770 $SITE_ROOT/storage; find $SITE_ROOT/storage/ -type d -exec chmod 0775 {} \; @@ -194,9 +207,8 @@ function site_update { # populate application database cd $target_dir php artisan migrate --env=$LARAVEL_ENV --force - update_node - npm install - npm run build + sudo npm install + sudo npm run build # activate site rm -rf $SITE_ROOT/w ln -s $target_dir $SITE_ROOT/w