Skip to content

Commit

Permalink
install node tools
Browse files Browse the repository at this point in the history
update s/w list in README with node tools
  • Loading branch information
capsulecorplab committed Mar 31, 2024
1 parent d37c3b8 commit 4406369
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

This repo provides an Immutable-Infrastructure-as-Code (IIaC) workspace for the Mars Desert Research Station (MDRS), based on an Ansible template for [KASM Ubuntu Jammy](https://hub.docker.com/r/kasmweb/core-ubuntu-jammy) images. The workspace is configured with the following software:

- Node JS Tools
- nodejs v20.11.1
- npm v10.2.4 (included with nodejs)
- npx v10.2.4 (included with nodejs)
- yarn v3.5.0
- oclif v3.10.0
- [cli-njk](https://github.com/elcharitas/cli-njk) v1.0.0
- git cli
- [Keychain](https://www.funtoo.org/Keychain)
- Firefox
Expand Down
100 changes: 100 additions & 0 deletions playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,106 @@
debug:
msg: "{{ disk_usage.stdout }}"

-
# Install NodeJS Tools
hosts: localhost
connection: local
gather_facts: yes
tags:
- install_node
- install_doctools

vars:
node_version: "18.5.0"
v_node_version: "v{{ node_version }}"
npm_version: "8.12.1"
npx_version: "8.12.1"
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
- name: Get npm version
shell: npm --version
register: installed_npm_version
- 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 }}"
- 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
- name: Test npm version
fail:
msg: "NPM Version Error: Expected {{ npm_version }} | Found {{ installed_npm_version.stdout }}"
when: installed_npm_version.stdout != npm_version
- name: Test npx version
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

roles:
- role: grzegorznowak.nvm_node
nvm_install_script_version: "0.39.3"
nvm_node_version: "{{ node_version }}"
nvm_install_globally:
- 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 fprime tools
hosts: localhost
Expand Down
1 change: 1 addition & 0 deletions requirements.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
# Add Ansible Galaxy Packages here, role_example_hello included to prevent errors in template testing
- grzegorznowak.nvm_node # https://galaxy.ansible.com/grzegorznowak/nvm_node
- irixjp.role_example_hello # https://galaxy.ansible.com/irixjp/role_example_hello
- staticdev.firefox # https://galaxy.ansible.com/staticdev/firefox
- gantsign.visual-studio-code # https://galaxy.ansible.com/gantsign/visual-studio-code
Expand Down

0 comments on commit 4406369

Please sign in to comment.