-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial circleci changes, this will fail * update tests to fix date formatting * for now, track node setup with vxsuite-build-system * switch to votingworks repo in docker hub with versioned images * circleci image version bump * remove package install dependency
- Loading branch information
Showing
5 changed files
with
58 additions
and
45 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
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,42 +1,54 @@ | ||
--- | ||
- name: Install Node and other dependencies | ||
- name: Install/Upgrade Node and other dependencies | ||
hosts: 127.0.0.1 | ||
connection: local | ||
become: true | ||
|
||
vars: | ||
node_version: "16.19.1*" | ||
node_repo_version: "16.x" | ||
node_version: "16.19.1" | ||
npm_packages: | ||
- yarn | ||
- yarn@1.22.15 | ||
- [email protected] | ||
|
||
tasks: | ||
|
||
- name: "Add nodejs apt key" | ||
ansible.builtin.apt_key: | ||
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key | ||
state: present | ||
|
||
- name: "Add nodejs {{ node_version }} apt repo" | ||
ansible.builtin.apt_repository: | ||
repo: deb https://deb.nodesource.com/node_{{ node_repo_version }} bullseye main | ||
update_cache: yes | ||
|
||
- name: "Add nodejs {{ node_version }} src apt repo" | ||
ansible.builtin.apt_repository: | ||
repo: deb-src https://deb.nodesource.com/node_{{ node_repo_version }} bullseye main | ||
update_cache: yes | ||
|
||
- name: "Install Node {{ node_version }}" | ||
ansible.builtin.apt: | ||
update_cache: yes | ||
name: "nodejs={{ node_version }}" | ||
state: present | ||
|
||
- name: "Install base npm packages" | ||
community.general.npm: | ||
global: yes | ||
name: "{{ item }}" | ||
loop: "{{ npm_packages }}" | ||
- name: Determine system architecture | ||
set_fact: | ||
architecture: "{{ 'arm64' if (ansible_architecture == 'aarch64' or ansible_architecture == 'arm64') else 'x64' if (ansible_architecture == 'x86_64') else 'unsupported' }}" | ||
|
||
- name: Remove pre-packaged Node (if present) | ||
ansible.builtin.package: | ||
name: nodejs | ||
state: absent | ||
|
||
- name: Install/Upgrade Node on supported architectures | ||
block: | ||
|
||
- name: Set Node release URL | ||
set_fact: | ||
release_url: "https://nodejs.org/dist/v{{ node_version }}/node-v{{ node_version }}-linux-{{ architecture }}.tar.gz" | ||
|
||
- name: Download and extract Node | ||
ansible.builtin.unarchive: | ||
src: "{{ release_url }}" | ||
dest: /usr/local | ||
remote_src: yes | ||
extra_opts: | ||
- --strip-components=1 | ||
|
||
- name: See if corepack is present | ||
command: "which corepack" | ||
register: corepack_installed | ||
ignore_errors: yes | ||
|
||
- name: Disable corepack if installed | ||
command: corepack disable | ||
when: corepack_installed.rc == 0 | ||
|
||
- name: Install package managers | ||
command: "npm install -g {{ item }}" | ||
loop: "{{ npm_packages }}" | ||
|
||
when: architecture != 'unsupported' | ||
|
||
|
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