Skip to content

Commit

Permalink
update node tools
Browse files Browse the repository at this point in the history
- updates node version to 20.11.1
- updates npm/npx version to 8.3.1
- updates yarn version to 1.22.11
- updates yo version 4.3.1
- updates generator version to 1.7.5
- installs oclif version 4.3.6
- installs typescript version 5.1.3
- installs cli-njk version 1.0.0
  • Loading branch information
capsulecorplab committed Mar 30, 2024
1 parent a3bafa6 commit 80ebe08
Showing 1 changed file with 51 additions and 15 deletions.
66 changes: 51 additions & 15 deletions playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -308,25 +308,30 @@
debug:
msg: "{{ disk_usage.stdout }}"


-
# install NodeJs
hosts: localhost
connection: local
gather_facts: yes
tags:
- install_doctools
- install_node
- install_doctools

vars:
node_version: "16.14.0"
node_version: "20.11.1"
v_node_version: "v{{ node_version }}"
npm_version: "8.3.1"
npx_version: "8.3.1"
yarn_version: "1.22.11"
yo_version: "4.3.0"
generator_code_version: "1.6.7"
npm_version: "10.2.4"
npx_version: "10.2.4"
yarn_version: "3.5.0"
yo_version: "4.3.1"
generator_code_version: "1.7.5"
oclif_version: "4.3.6"
typescript_version: "5.1.3"
cli_njk_version: "1.0.0"

tasks: # Test Node JS Tools versions
- name: Install Yarn
shell: "corepack enable && corepack prepare yarn@{{ yarn_version }} --activate"
- name: Get node version
shell: node --version
register: installed_node_version
Expand All @@ -338,14 +343,29 @@
register: installed_npx_version
- name: Get yarn version
shell: yarn --version
register: installed_yarn_version
register: installed_yarn_version
- name: Get oclif version
shell: oclif --version 2>/dev/null | sed 's/\ /\n/g' | grep oclif | sed 's/\///g' | sed 's/[[:alpha:]|(|[:space:]]//g'
register: installed_oclif_version
- name: Get TypeScript Compiler version
shell: tsc --version | sed 's/[[:alpha:]|(|[:space:]]//g'
register: installed_tsc_version
- name: Get cli-njk version
shell: njk --version
register: installed_cli_njk_version
- name: Display node tool versions
debug:
msg: "Node = {{ installed_node_version.stdout }} | npm = {{ installed_npm_version.stdout }} | npx = {{ installed_npx_version.stdout }} | yarn = {{ installed_yarn_version.stdout }}"
- name: Display TypeScript Compiler version
debug:
msg: "tsc = {{ installed_tsc_version.stdout }}"
- name: Display cli-njk version
debug:
msg: "cli-njk = {{ installed_cli_njk_version.stdout }}"
- name: Test node version
fail:
msg: "NodeJS Version Error: Expected {{ v_node_version }} | Found {{ installed_node_version.stdout }}"
when: installed_node_version.stdout != v_node_version
when: installed_node_version.stdout != v_node_version
- name: Test npm version
fail:
msg: "NPM Version Error: Expected {{ npm_version }} | Found {{ installed_npm_version.stdout }}"
Expand All @@ -358,25 +378,41 @@
fail:
msg: "Yarn Version Error: Expected {{ yarn_version }} | Found {{ installed_yarn_version.stdout }}"
when: installed_yarn_version.stdout != yarn_version
- name: Test oclif version
fail:
msg: "oclif Version Error: Expected {{ oclif_version }} | Found {{ installed_oclif_version.stdout }}"
when: installed_oclif_version.stdout != oclif_version
when: installed_yarn_version.stdout != yarn_version
- name: Test TypeScript Compiler version
fail:
msg: "TypeScript Compiler Version Error: Expected {{ typescript_version }} | Found {{ installed_tsc_version.stdout }}"
when: installed_tsc_version.stdout != typescript_version
- name: Test cli-njk version
fail:
msg: "cli-njk Version Error: Expected {{ cli_njk_version }} | Found {{ installed_cli_njk_version.stdout }}"
when: installed_cli_njk_version.stdout != cli_njk_version
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"


roles:
- role: grzegorznowak.nvm_node
nvm_install_script_version: "0.39.1"
nvm_node_version: "{{ node_version }}"
nvm_install_script_version: "0.39.3"
nvm_node_version: "{{ node_version }}"
nvm_install_globally:
- name: yarn
version: "{{ yarn_version }}"
- name: yo
version: "{{ yo_version }}"
- name: generator-code
version: "{{ generator_code_version }}"
- name: oclif
version: "{{ oclif_version }}"
- name: typescript
version: "{{ typescript_version }}"
- name: cli-njk
version: "{{ cli_njk_version }}"

-
# install Hugo (extended)
Expand Down

0 comments on commit 80ebe08

Please sign in to comment.