Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): move windows nodejs to choco config #2623

Merged
1 commit merged into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/chocolatey.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<package id="gradle" version="6.8.3" />
<package id="sbt" version="1.5.5" />
<package id="awscli" version="2.4.12" />
<package id="nodejs" version="16.13.2" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I guess this can't be pulled from some global CI config?

Copy link
Author

@ghost ghost Jan 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. I'm thinking in a future PR, if we really wanted consistency, we can create a script to generate this file on-demand. That script can be called inside our CI config and pass through package and version parameters. Doesn't seem worth the complexity right now.

</packages>
20 changes: 5 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ commands:
- << parameters.npm_cache_directory >>
install_sdks_windows:
steps:
- run:
name: Removing pre-installed NodeJS
command: |
$current_node_version = node --version
nvm uninstall $current_node_version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks odd - can't we just override the default? Or use some different image?

Copy link
Author

@ghost ghost Jan 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows uses a VM image, so we can't. I tried keeping the pre-installed one but it takes precedence (nvm probably dumps itself at the start). To change that, we'd require even more brittle setup logic to change PATH ordering.

It's possible in the future once we've got the split builds and testing done, we can remove our custom NodeJS install completely and use the default one that comes with the Windows image.

To clarify, this logic existed before in a separate command, I moved it into a single command.

- restore_cache:
name: Restoring Chocolatey cache
keys:
Expand Down Expand Up @@ -119,19 +124,6 @@ commands:
key: sdkman-archive-cache-v3-{{ arch }}-{{ checksum ".circleci/install-sdks-linux.sh" }}
paths:
- ~/.sdkman/archives
install_node_windows:
parameters:
node_version:
type: string
steps:
- run:
name: Removing pre-installed NodeJS
command: |
$current_node_version = node --version
nvm uninstall $current_node_version
- run:
name: Installing NodeJS
command: choco install nodejs --version=<< parameters.node_version >> --no-progress
install_shellspec_dependencies:
steps:
- run:
Expand Down Expand Up @@ -248,8 +240,6 @@ jobs:
- checkout
- attach_workspace:
at: .
- install_node_windows:
node_version: << parameters.node_version >>
- install_sdks_windows
- setup_npm:
node_version: << parameters.node_version >>
Expand Down