-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #223 from consuldemocracy/install_specific_nodejs_…
…version Install specific nodejs version
- Loading branch information
Showing
12 changed files
with
60 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
roles: | ||
- folder_structure | ||
- ruby | ||
- nodejs | ||
- rails | ||
- queue | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
- include: timezone.yml | ||
- include_tasks: timezone.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,13 @@ smtp_authentication: "plain" | |
#LetsEncrypt | ||
#letsencrypt_email: "[email protected]" | ||
|
||
# Node.js | ||
fnm_dir: "{{ home_dir }}/.fnm" | ||
fnm_command: "export PATH=\"{{ fnm_dir }}/:$PATH\" && eval \"$(fnm env)\"" | ||
|
||
# RVM | ||
rvm_command: "source {{ home_dir }}/.rvm/scripts/rvm" | ||
|
||
# Errbit | ||
errbit: False | ||
errbit_dir: "{{ home_dir }}/errbit" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
- name: Install fnm | ||
shell: | | ||
curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "{{ fnm_dir }}" | ||
args: | ||
chdir: "{{ home_dir }}" | ||
executable: /bin/bash | ||
creates: "{{ fnm_dir }}/fnm" | ||
|
||
- name: Read Node.js version | ||
shell: "cat .node-version" | ||
args: | ||
chdir: "{{ release_dir }}" | ||
register: node_version | ||
|
||
- name: Install nodejs via fnm | ||
shell: "{{ fnm_command }} && {{ rvm_command }} && fnm install {{ node_version.stdout }}" | ||
args: | ||
chdir: "{{ release_dir }}" | ||
executable: /bin/bash | ||
register: fnm_install_result | ||
until: "fnm_install_result is not failed" | ||
retries: 10 | ||
delay: 10 | ||
|
||
- name: Install Node packages | ||
shell: "{{ fnm_command }} && {{ rvm_command }} && fnm exec npm install --production" | ||
args: | ||
chdir: "{{ release_dir }}" | ||
executable: /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
- name: Start DelayedJobs queue | ||
shell: "source /home/{{ deploy_user }}/.rvm/scripts/rvm && RAILS_ENV={{ env }} bin/delayed_job -m -n 2 restart" | ||
shell: "{{ fnm_command }} && {{ rvm_command }} && RAILS_ENV={{ env }} fnm exec bin/delayed_job -m -n 2 restart" | ||
args: | ||
executable: /bin/bash | ||
chdir: "{{ release_dir }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,6 @@ | |
- libffi-dev | ||
- curl | ||
- libcurl4-openssl-dev | ||
- nodejs | ||
- libpq-dev | ||
- imagemagick | ||
- ruby-dev | ||
|