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(si-fs): repurpose install.sh script to install si-fs #5514

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

fnichol
Copy link
Contributor

@fnichol fnichol commented Feb 20, 2025

This change updates the pre-existing install.sh script (found under the auth portal's public/ directory) to target the downloading and installation of a bin/si-fs binary from the artifact repository.

The help usage is as follows:

install.sh

Installs a binary release of si-fs for supported platforms

USAGE:
    install.sh [OPTIONS] [--]

OPTIONS:
    -h, --help                Prints help information
    -d, --destination=<DEST>  Destination directory for installation
                              [default: /home/fnichol/.local/bin]
    -p, --platform=<PLATFORM> Platform type to install
                              [examples: linux-x86_64, darwin-aarch64]
                              [default: linux-x86_64]
    -V, --version=<VERSION>   Release version to install
                              [examples: stable,
                              20250218.210911.0-sha.bda1ce6ea]
                              [default: stable]

EXAMPLES:
    # Installs the latest release into `$HOME/bin`
    install.sh

    # Installs the latest release for all users under `/usr/local/bin`
    sudo install.sh

    # Installs an old release into a temp directory
    install.sh -V 20250214.193652.0-sha.0f9972a53 -d /tmp

The default will be to download the current stable version for the target platform (currently only linux-x86_64 and linux-aarch64 are supported) and install it under one of the following locations (first path that is present in the user's $PATH wins):

  • $HOME/.local/bin
  • $HOME/bin
  • Falls back to $HOME/.si-fs/bin if none of the above are found in $PATH

If a root user (that is uid == 0) is installing, the default destination will be /usr/local/bin.

This change updates the pre-existing `install.sh` script (found under
the auth portal's `public/` directory) to target the downloading and
installation of a `bin/si-fs` binary from the artifact repository.

The help usage is as follows:

```
install.sh

Installs a binary release of si-fs for supported platforms

USAGE:
    install.sh [OPTIONS] [--]

OPTIONS:
    -h, --help                Prints help information
    -d, --destination=<DEST>  Destination directory for installation
                              [default: /home/fnichol/.local/bin]
    -p, --platform=<PLATFORM> Platform type to install
                              [examples: linux-x86_64, darwin-aarch64]
                              [default: linux-x86_64]
    -V, --version=<VERSION>   Release version to install
                              [examples: stable,
                              20250218.210911.0-sha.bda1ce6ea]
                              [default: stable]

EXAMPLES:
    # Installs the latest release into `$HOME/bin`
    install.sh

    # Installs the latest release for all users under `/usr/local/bin`
    sudo install.sh

    # Installs an old release into a temp directory
    install.sh -V 20250214.193652.0-sha.0f9972a53 -d /tmp

```

The default will be to download the current `stable` version for the
target platform (currently only `linux-x86_64` and `linux-aarch64` are
supported) and install it under one of the following locations (first
path that is present in the user's `$PATH` wins):

- `$HOME/.local/bin`
- `$HOME/bin`
- Falls back to `$HOME/.si-fs/bin` if none of the above are found in
  `$PATH`

If a `root` user (that is `uid == 0`) is installing, the default
destination will be `/usr/local/bin`.

Signed-off-by: Fletcher Nichol <[email protected]>
Copy link

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@fnichol
Copy link
Contributor Author

fnichol commented Feb 20, 2025

Note that there isn't yet a stable artifact, so you can pluck a version from https://artifacts.systeminit.com/#si-fs/ to try out the installer.

@fnichol
Copy link
Contributor Author

fnichol commented Feb 20, 2025

A decent "curl-sh" invocation for this installer, once merged would be:

curl -sSf https://auth.systeminit.com/install.sh | sh -s --

Which allows you to add additional CLI arguments on the end, for example to see the help:

curl -sSf https://auth.systeminit.com/install.sh | sh -s -- --help

To download an older version:

curl -sSf https://auth.systeminit.com/install.sh | sh -s -- --version=20250219.172148.0-sha.8fed41d9c

@stack72 stack72 added this pull request to the merge queue Feb 20, 2025
Merged via the queue into main with commit 0ed99ca Feb 20, 2025
10 checks passed
@stack72 stack72 deleted the fnichol/si-fs-install-sh branch February 20, 2025 16:39
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