Browse Source

Merge "Updated deploy functions"

Zuul 2 months ago
parent
commit
e95f2ed56e
1 changed files with 22 additions and 10 deletions
  1. 22
    10
      files/functions

+ 22
- 10
files/functions View File

@@ -53,8 +53,23 @@ function site_init {
53 53
     # link configuration files managed by puppet
54 54
 
55 55
     ln -sf /etc/openstackid/.env $target_dir/.env
56
+
56 57
     # convert app/storage into symlink and set permissions
57 58
     mv $target_dir/storage $SITE_ROOT/
59
+    # check for new storage structure ( LV 5.x)
60
+    if [[ ! -d $SITE_ROOT/storage/framework ]]; then
61
+        mkdir -p $SITE_ROOT/storage/framework;
62
+        mkdir -p $SITE_ROOT/storage/framework/cache;
63
+        mkdir -p $SITE_ROOT/storage/framework/views;
64
+        mkdir -p $SITE_ROOT/storage/framework/sessions;
65
+    fi
66
+    if [[ ! -d $SITE_ROOT/storage/app ]]; then
67
+        mkdir -p $SITE_ROOT/storage/app;
68
+        mkdir -p $SITE_ROOT/storage/app/public;
69
+    fi
70
+    if [[ ! -d $SITE_ROOT/storage/logs ]]; then
71
+        mkdir -p $SITE_ROOT/storage/logs;
72
+    fi
58 73
     chmod 02770 $SITE_ROOT/storage
59 74
     find $SITE_ROOT/storage/ -type d -exec chmod 0775 {} \;
60 75
     find $SITE_ROOT/storage/ -type f -exec chmod 0664 {} \;
@@ -68,9 +83,8 @@ function site_init {
68 83
         php artisan db:seed --env=$LARAVEL_ENV --force
69 84
     fi
70 85
 
71
-    update_node
72
-    npm install
73
-    npm run build
86
+    sudo npm install
87
+    sudo npm run build
74 88
     # activate site
75 89
     rm -rf $SITE_ROOT/w
76 90
     ln -s $SITE_ROOT/slot0 $SITE_ROOT/w
@@ -117,10 +131,6 @@ function catalog_get_version {
117 131
     echo $RELEASE_DATE
118 132
 }
119 133
 
120
-function update_node {
121
-    npm install -g n;
122
-    n latest;
123
-}
124 134
 
125 135
 function site_update {
126 136
     if [ ! $1 ]; then
@@ -186,6 +196,9 @@ function site_update {
186 196
         mkdir -p $SITE_ROOT/storage/app;
187 197
         mkdir -p $SITE_ROOT/storage/app/public;
188 198
     fi
199
+    if [[ ! -d $SITE_ROOT/storage/logs ]]; then
200
+        mkdir -p $SITE_ROOT/storage/logs;
201
+    fi
189 202
     # set permissions
190 203
     chmod 02770 $SITE_ROOT/storage;
191 204
     find $SITE_ROOT/storage/ -type d -exec chmod 0775 {} \;
@@ -194,9 +207,8 @@ function site_update {
194 207
     # populate application database
195 208
     cd $target_dir
196 209
     php artisan migrate --env=$LARAVEL_ENV --force
197
-    update_node
198
-    npm install
199
-    npm run build
210
+    sudo npm install
211
+    sudo npm run build
200 212
     # activate site
201 213
     rm -rf $SITE_ROOT/w
202 214
     ln -s $target_dir $SITE_ROOT/w

Loading…
Cancel
Save