Skip to content

Commit

Permalink
attempt to fix installed yarn version
Browse files Browse the repository at this point in the history
- remove cli_njk
- update npm version to 10.7.0
- update yo version to 5.0.0
- update generator_code
- update oclif version to 4.14.6
  • Loading branch information
capsulecorplab committed Nov 8, 2024
1 parent 10e5a1a commit 4f60359
Showing 1 changed file with 33 additions and 38 deletions.
71 changes: 33 additions & 38 deletions playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,20 +225,16 @@
- install_doctools

vars:
node_version: "20.11.1"
node_version: "20.15.1"
v_node_version: "v{{ node_version }}"
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"
npm_version: "10.7.0"
npx_version: "10.7.0"
yo_version: "5.0.0"
generator_code_version: "1.11.1"
oclif_version: "4.14.6"
typescript_version: "5.5.3"

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 @@ -248,27 +244,18 @@
- name: Get npx installed version
shell: npx --version
register: installed_npx_version
- name: Get yarn version
shell: 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 }}"
msg: "Node = {{ installed_node_version.stdout }} | npm = {{ installed_npm_version.stdout }} | npx = {{ installed_npx_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 }}"
Expand All @@ -281,29 +268,14 @@
fail:
msg: "NPX Version Error: Expected {{ npx_version }} | Found {{ installed_npx_version.stdout }}"
when: installed_npx_version.stdout != npx_version
- name: Test yarn version
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
Expand All @@ -318,8 +290,31 @@
version: "{{ oclif_version }}"
- name: typescript
version: "{{ typescript_version }}"
- name: cli-njk
version: "{{ cli_njk_version }}"

-
# Install Yarn
hosts: localhost
connection: local
gather_facts: yes
tags:
- install_yarn

vars:
yarn_version: "4.3.1"

tasks:
- name: Install Yarn
shell: "corepack enable && corepack prepare yarn@{{ yarn_version }} --activate"
- name: Get yarn version
shell: yarn --version
register: installed_yarn_version
- name: Display yarn versions
debug:
msg: "yarn = {{ installed_yarn_version.stdout }}"
- name: Test yarn version
fail:
msg: "Yarn Version Error: Expected {{ yarn_version }} | Found {{ installed_yarn_version.stdout }}"
when: installed_yarn_version.stdout != yarn_version

-
# install sudo for the vs-code role below
Expand Down

0 comments on commit 4f60359

Please sign in to comment.