Quellcode durchsuchen

Create and migrate database

tags/v1.0.0
Benjamin Neff vor 7 Jahren
Ursprung
Commit
9cf378625f
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden
1 geänderte Dateien mit 27 neuen und 0 gelöschten Zeilen
  1. +27
    -0
      diaspora/install.sls

+ 27
- 0
diaspora/install.sls Datei anzeigen

@@ -103,3 +103,30 @@ diaspora_bundle_install:
- RAILS_ENV: {{ diaspora.environment }}
- require:
- git: diaspora_git

diaspora_create_database:
cmd.run:
- name: rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/rake db:create db:schema:load
- runas: diaspora
- cwd: {{ diaspora.install_path }}
- onlyif: rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/rails runner "ActiveRecord::Base.connection" |& grep "database \"{{ diaspora.database.database }}\" does not exist (ActiveRecord::NoDatabaseError)"
- env:
- RAILS_ENV: {{ diaspora.environment }}
- require:
- file: {{ diaspora.install_path }}/config/database.yml
- file: {{ diaspora.install_path }}/config/diaspora.yml
- onchanges:
- git: diaspora_git

diaspora_migrate_database:
cmd.run:
- name: rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/rake db:migrate
- runas: diaspora
- cwd: {{ diaspora.install_path }}
- onlyif: rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/rake db:migrate:status | grep -oE "^\s+down"
- env:
- RAILS_ENV: {{ diaspora.environment }}
- require:
- cmd: diaspora_create_database
- onchanges:
- git: diaspora_git

Laden…
Abbrechen
Speichern