Parcourir la source

Use bash -c to change directory and add env vars for unless/onlyif

cwd and env is not passed to unless/onlyif anymore in salt 3001
tags/v1.0.0
Benjamin Neff il y a 4 ans
Parent
révision
e06124fff6
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. +3
    -3
      diaspora/install.sls

+ 3
- 3
diaspora/install.sls Voir le fichier

@@ -150,7 +150,7 @@ diaspora_bundle_install:
- name: rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/bundle install --full-index
- runas: {{ diaspora.user.username }}
- cwd: {{ diaspora.install_path }}
- unless: rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/bundle check
- unless: bash -c 'cd {{ diaspora.install_path }}; RAILS_ENV={{ environment }} rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/bundle check'
- env:
- RAILS_ENV: {{ environment }}
- require:
@@ -161,7 +161,7 @@ diaspora_create_database:
- name: rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/rake db:create db:migrate
- runas: {{ diaspora.user.username }}
- 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)"
- onlyif: bash -c 'cd {{ diaspora.install_path }}; RAILS_ENV={{ environment }} 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: {{ environment }}
- require:
@@ -176,7 +176,7 @@ diaspora_migrate_database:
- name: rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/rake db:migrate
- runas: {{ diaspora.user.username }}
- cwd: {{ diaspora.install_path }}
- onlyif: rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/rake db:migrate:status | grep -oE "^\s+down"
- onlyif: bash -c 'cd {{ diaspora.install_path }}; RAILS_ENV={{ environment }} rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/rake db:migrate:status | grep -oE "^\s+down"'
- env:
- RAILS_ENV: {{ environment }}
- require:

Chargement…
Annuler
Enregistrer