瀏覽代碼

Add RAILS_ENV to diaspora user login shell

master
Benjamin Neff 7 年之前
父節點
當前提交
45afdf81aa
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 17 行新增3 行删除
  1. +17
    -3
      diaspora/install.sls

+ 17
- 3
diaspora/install.sls 查看文件

@@ -28,15 +28,14 @@ redis_service:
- name: {{ diaspora.redis_service }}
{%- endif %}

{% set home = diaspora.user.home if 'home' in diaspora.user else '/home/' + diaspora.user.username %}
diaspora_user:
user.present:
- name: {{ diaspora.user.username }}
{%- if 'shell' in diaspora.user %}
- shell: {{ diaspora.user.shell }}
{%- endif %}
{%- if 'home' in diaspora.user %}
- home: {{ diaspora.user.home }}
{%- endif %}
- home: {{ home }}

diaspora_rvm_gpg_key:
cmd.run:
@@ -99,6 +98,21 @@ diaspora_rvm_ruby_version_alias:
- rvm: diaspora_rvm_ruby
- git: diaspora_git

diaspora_rails_env_for_login_shell:
file.replace:
{%- if 'shell' in diaspora.user and diaspora.user.shell == "/bin/zsh" %}
- name: {{ home }}/.zshrc
{%- else %}
- name: {{ home }}/.bashrc
{%- endif %}
- pattern: "export RAILS_ENV=\"[a-z]*\""
- repl: "export RAILS_ENV=\"{{ environment }}\""
- append_if_not_found: True
- not_found_content: "\nexport RAILS_ENV=\"{{ environment }}\""
- ignore_if_missing: True
- require:
- rvm: diaspora_rvm_ruby

diaspora_bundle_install:
cmd.run:
- name: rvm ruby-{{ diaspora.ruby_version }}@diaspora do bin/bundle install --jobs $(nproc) --deployment --without test development --with {{ diaspora.database.type }}

Loading…
取消
儲存