Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
javierm committed Oct 9, 2023
1 parent 39fd5c7 commit 1e9ca42
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions roles/nodejs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,17 @@
register: node_version

- name: Install nodejs via fnm
shell:
cmd: |
eval "$(fnm env)"
fnm install {{ node_version.stdout }}
chdir: "{{ release_dir }}"
executable: /bin/bash
environment:
PATH: "{{ fnm_dir }}:{{ ansible_env.PATH }}"
shell: |
export PATH="{{ fnm_dir }}:$PATH"
eval "$(fnm env)"
fnm install {{ node_version.stdout }}
chdir: "{{ release_dir }}"
executable: /bin/bash

- name: Install Node packages
shell:
cmd: |
eval "$(fnm env)"
fnm exec npm install --production
chdir: "{{ release_dir }}"
executable: /bin/bash
environment:
PATH: "{{ fnm_dir }}:{{ ansible_env.PATH }}"
shell: |
export PATH="{{ fnm_dir }}:$PATH"
eval "$(fnm env)"
fnm exec npm install --production
chdir: "{{ release_dir }}"
executable: /bin/bash

0 comments on commit 1e9ca42

Please sign in to comment.