Browse Source

Added DB seeding support

added db seeding support configuration on install site command
by default is disabled to avoid overwriten existent db

Change-Id: Iba74a5f6f8a08f73d73bc0ca2d499ea215cf8c8a
Sebastian Marcet 3 years ago
parent
commit
79e17cabef
3 changed files with 7 additions and 3 deletions
  1. 3
    1
      files/functions
  2. 1
    0
      manifests/init.pp
  3. 3
    2
      templates/openstackid.conf.erb

+ 3
- 1
files/functions View File

@@ -68,7 +68,9 @@ function site_init {
68 68
     # populate application database
69 69
     cd $target_dir
70 70
     php artisan migrate --env=$LARAVEL_ENV
71
-    php artisan db:seed --env=$LARAVEL_ENV
71
+    if [[ $USE_DB_SEEDING -eq 1 ]]; then
72
+        php artisan db:seed --env=$LARAVEL_ENV
73
+    fi
72 74
     update_node
73 75
     install_bower
74 76
     # activate site

+ 1
- 0
manifests/init.pp View File

@@ -60,6 +60,7 @@ class openstackid (
60 60
   $email_smtp_server_port = 587,
61 61
   $email_smtp_server_user = '',
62 62
   $email_smtp_server_password = '',
63
+  $use_db_seeding = false,
63 64
 ) {
64 65
 
65 66
   # php packages needed for openid server

+ 3
- 2
templates/openstackid.conf.erb View File

@@ -1,5 +1,6 @@
1 1
 SITE_ROOT=/srv/openstackid
2 2
 SOURCE_TARBALL=http://tarballs.openstack.org/openstackid/openstackid-<%= @openstackid_release %>.tar.gz
3
-LARAVEL_ENV=dev
3
+LARAVEL_ENV=<%= @id_environment %>
4 4
 RELEASE_NAME=openstackid-<%= @openstackid_release %>.tar.gz
5
-SOURCE_ROOT=http://tarballs.openstack.org/openstackid/
5
+SOURCE_ROOT=http://tarballs.openstack.org/openstackid/
6
+USE_DB_SEEDING=<%= @use_db_seeding?1:0 %>

Loading…
Cancel
Save