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

Feature/sc 126216/update linux mac cli installer to use new #727

Conversation

hugomontero
Copy link
Contributor

@hugomontero hugomontero commented Apr 15, 2024

Description

This PR will add cli-installer for unix systems (macos, linux)

How to Test

  1. Download the installer: https://binaries.staging.particle.io/particle-cli/installer/install-cli
  2. Run the installer for an specific version: VERSION=3.23.0 ./{path}/install-cli
  3. Attempt to use particle command in a new terminal: particle update-cli --help

outcome
Once installed you will be able to see the new options for update-cli command:

Related Issues / Discussions

Story details: https://app.shortcut.com/particle/story/126216

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA
  • Problem and solution clearly stated
  • Tests have been provided
  • Docs have been updated
  • CI is passing

@hugomontero hugomontero force-pushed the feature/sc-126216/update-linux-mac-cli-installer-to-use-new branch from 2694b20 to 4f8dfbd Compare April 16, 2024 15:10
@hugomontero hugomontero marked this pull request as ready for review April 16, 2024 19:16

VERSION=${VERSION}
BINARY="particle"
DEST_PATH="$HOME/bin"
DEST="$DEST_PATH/$BINARY"
MANIFEST_URL="https://binaries.particle.io/particle-cli/manifest.json"
MANIFEST_HOST=${MANIFEST_HOST:-binaries.particle.io}
Copy link
Member

Choose a reason for hiding this comment

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

Use MANIFEST_HOST=binaries.staging.particle.io VERSION=3.23.0 ./install-cli for testing

BINARY_URL=$(curl -s $MANIFEST_URL | $PYTHON -c "import sys, json; print(json.load(sys.stdin)['builds']['$OS']['$ARCH']['url'])")
BINARY_SHA256=$(curl -s $MANIFEST_URL | $PYTHON -c "import sys, json; print(json.load(sys.stdin)['builds']['$OS']['$ARCH']['sha256'])")
echo ":::: Installing the Particle CLI for $OS $ARCH"
MANIFEST=$(curl -s --fail $MANIFEST_URL)
Copy link
Member

Choose a reason for hiding this comment

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

--fail causes curl to exit with error code 22 if the file can't be downloaded (HTTP 400 or above).

Copy link
Member

@monkbroc monkbroc left a comment

Choose a reason for hiding this comment

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

Looks great. I made a few tweak

@hugomontero hugomontero merged commit 87f794a into feature/cli-installer-v2 Apr 17, 2024
1 check passed
@monkbroc monkbroc deleted the feature/sc-126216/update-linux-mac-cli-installer-to-use-new branch May 8, 2024 14:36
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.

None yet

2 participants