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

feat: add nodejs to system install #675

Merged
merged 1 commit into from
Jun 29, 2022
Merged

feat: add nodejs to system install #675

merged 1 commit into from
Jun 29, 2022

Conversation

dirien
Copy link
Contributor

@dirien dirien commented Apr 10, 2022

Signed-off-by: Engin Diri [email protected]

Description

This PR adds node to the system install fn of arkade.

You can install from the stable release or choose a nightly build from the nightly channel

Motivation and Context

How Has This Been Tested?

Latest from release channel

❯ docker container run --rm -v $(pwd):/workspace -ti golang:1.16 bash
root@b2e70d12efcf:/go# cd /workspace/
root@b2e70d12efcf:/workspace# go build .
root@b2e70d12efcf:/workspace# ./arkade system install node
Installing Node.js to /usr/local/lib/nodejs
Installing version: v17.9.0 for: x64
Downloading from: https://nodejs.org/download/release/v17.9.0/node-v17.9.0-linux-x64.tar.gz
40.97 MiB / 40.97 MiB [--------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00%
Downloaded to: /tmp/node-v17.9.0-linux-x64.tar.gz
Unpacking binaries to: /tmp/node1248639963
2022/04/10 19:36:46 extracted tarball into /tmp/node1248639963: 4641 files, 1171 dirs (1.29905914s)
Copying binaries to: /usr/local/lib/nodejs
root@b2e70d12efcf:/workspace# node --version
v17.9.0

From nightly channel

❯ docker container run --rm -v $(pwd):/workspace -ti golang:1.16 bash
root@08890b3376e3:/go# cd /workspace/
root@08890b3376e3:/workspace# go build .
root@08890b3376e3:/workspace# ./arkade system install node --version v18.0.0-nightly20220410a0461255c0  --channel nightly
Installing Node.js to /usr/local/lib/nodejs
Installing version: v18.0.0-nightly20220410a0461255c0 for: x64
Downloading from: https://nodejs.org/download/nightly/v18.0.0-nightly20220410a0461255c0/node-v18.0.0-nightly20220410a0461255c0-linux-x64.tar.gz
41.35 MiB / 41.35 MiB [--------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00%
Downloaded to: /tmp/node-v18.0.0-nightly20220410a0461255c0-linux-x64.tar.gz
Unpacking binaries to: /tmp/node4070689855
2022/04/10 19:40:01 extracted tarball into /tmp/node4070689855: 4639 files, 1172 dirs (1.545232732s)
Copying binaries to: /usr/local/lib/nodejs
root@08890b3376e3:/workspace# node --version
v18.0.0-nightly20220410a0461255c0

Are you a GitHub Sponsor (Yes/No?)

  • Yes
  • No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Documentation

  • I have updated the list of tools in README.md if (required) with ./arkade get -o markdown
  • I have updated the list of apps in README.md if (required) with ./arkade install --help

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have tested this on arm, or have added code to prevent deployment

@alexellis
Copy link
Owner

Thank you. Please can you try to match the style that I used in the new CNI plugins app or the Go app? I noticed Richard's PR had introduced lots of extracted variables and consts.

@dirien
Copy link
Contributor Author

dirien commented Apr 10, 2022

@alexellis, Yes I try to align with your recent changes.

Any particular code piece you saw? Would help me

cmd/system/node.go Outdated Show resolved Hide resolved
cmd/system/node.go Outdated Show resolved Hide resolved
cmd/system/node.go Outdated Show resolved Hide resolved
cmd/system/node.go Outdated Show resolved Hide resolved
cmd/system/node.go Outdated Show resolved Hide resolved
cmd/system/node.go Outdated Show resolved Hide resolved
cmd/system/node.go Outdated Show resolved Hide resolved
cmd/system/node.go Outdated Show resolved Hide resolved
Copy link
Owner

@alexellis alexellis left a comment

Choose a reason for hiding this comment

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

Adding a few review comments.

@dirien
Copy link
Contributor Author

dirien commented Apr 13, 2022

Hi @alexellis, removed the symlink stuff and added your feedback.

To only issue I have is, that I need to copy the content of the archive to the /usr/local folder.

Maybe you have an idea

@alexellis
Copy link
Owner

To only issue I have is, that I need to copy the content of the archive to the /usr/local folder.
Maybe you have an idea

We have a couple of Untar methods to try out, what does each do vs. what we need?

Do we need a 3rd Untar method?

cmd/system/node.go Outdated Show resolved Hide resolved
Copy link
Owner

@alexellis alexellis left a comment

Choose a reason for hiding this comment

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

Do you think we can get this turned around this week?

@dirien
Copy link
Contributor Author

dirien commented Jun 6, 2022

Hi @alexellis, PR is ready to review and merge. Looking forward for your feedback!

@dirien dirien requested a review from alexellis June 6, 2022 13:19
Copy link
Owner

@alexellis alexellis left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you very much for this.

@alexellis alexellis merged commit 6b561cc into alexellis:master Jun 29, 2022
@alexellis
Copy link
Owner

Danke sehr.

Do you have a mode added already for quiet output?

@dirien dirien deleted the nodejs branch June 29, 2022 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants