Skip to content

Commit

Permalink
Merge pull request #241 from consuldemocracy/simplify_fnm_exec
Browse files Browse the repository at this point in the history
Only use fnm exec when necessary
  • Loading branch information
javierm authored Jun 27, 2024
2 parents afe3143 + 38f8e25 commit 7380cfd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion roles/errbit/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
replace: ' errbit_host: "https://{{ errbit_domain }}"'

- name: Restart CONSUL DEMOCRACY
shell: "{{ fnm_command }} && {{ rvm_command }} && fnm exec bin/rails restart RAILS_ENV={{ env }}"
shell: "{{ rvm_command }} && bin/rails restart RAILS_ENV={{ env }} EXECJS_RUNTIME=Disabled"
args:
chdir: "{{ release_dir }}"
executable: /bin/bash
Expand Down
4 changes: 2 additions & 2 deletions roles/nodejs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
register: node_version

- name: Install nodejs via fnm
shell: "{{ fnm_command }} && {{ rvm_command }} && fnm install {{ node_version.stdout }}"
shell: "{{ fnm_command }} && fnm install {{ node_version.stdout }}"
args:
chdir: "{{ release_dir }}"
executable: /bin/bash
Expand All @@ -24,7 +24,7 @@
delay: 10

- name: Install Node packages
shell: "{{ fnm_command }} && {{ rvm_command }} && fnm exec npm install --production"
shell: "{{ fnm_command }} && fnm exec npm install --production"
args:
chdir: "{{ release_dir }}"
executable: /bin/bash
2 changes: 1 addition & 1 deletion roles/queue/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: Start DelayedJobs queue
shell: "{{ fnm_command }} && {{ rvm_command }} && RAILS_ENV={{ env }} fnm exec bin/delayed_job -m -n 2 restart"
shell: "{{ rvm_command }} && RAILS_ENV={{ env }} EXECJS_RUNTIME=Disabled bin/delayed_job -m -n 2 restart"
args:
executable: /bin/bash
chdir: "{{ release_dir }}"
8 changes: 4 additions & 4 deletions roles/rails/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
replace: '{{ env }}:\n # secret_key_base: ""\n server_name: "{{ server_hostname }}"'

- name: Generate secret key
shell: "{{ fnm_command }} && {{ rvm_command }} && fnm exec bin/rake secret RAILS_ENV={{ env }}"
shell: "{{ rvm_command }} && bin/rake secret RAILS_ENV={{ env }} EXECJS_RUNTIME=Disabled"
register: secret_key_base
args:
chdir: "{{ release_dir }}"
Expand All @@ -86,13 +86,13 @@
when: domain is not defined

- name: Create Database
shell: "{{ fnm_command }} && {{ rvm_command }} && fnm exec bin/rake db:migrate RAILS_ENV={{ env }}"
shell: "{{ rvm_command }} && bin/rake db:migrate RAILS_ENV={{ env }} EXECJS_RUNTIME=Disabled"
args:
chdir: "{{ release_dir }}"
executable: /bin/bash

- name: Load configuration seeds
shell: "{{ fnm_command }} && {{ rvm_command }} && fnm exec bin/rake db:seed RAILS_ENV={{ env }}"
shell: "{{ rvm_command }} && bin/rake db:seed RAILS_ENV={{ env }} EXECJS_RUNTIME=Disabled"
args:
chdir: "{{ release_dir }}"
executable: /bin/bash
Expand All @@ -104,7 +104,7 @@
executable: /bin/bash

- name: Update crontab with whenever
shell: "{{ fnm_command }} && {{ rvm_command }} && fnm exec bundle exec whenever --update-crontab {{ app_name }} --set environment={{ env }}"
shell: "{{ rvm_command }} && EXECJS_RUNTIME=Disabled bundle exec whenever --update-crontab {{ app_name }} --set environment={{ env }}"
args:
chdir: "{{ release_dir }}"
executable: /bin/bash

0 comments on commit 7380cfd

Please sign in to comment.