From e29ff9515fe34ecbef89a63243df3166e5b8a3f5 Mon Sep 17 00:00:00 2001 From: Pierre beucher Date: Tue, 30 Jul 2024 22:25:26 +0200 Subject: [PATCH] feat: allow installation of specific branch or commit --- README.md | 8 +++++++- hack/prepare-release.sh | 2 +- install.sh | 8 ++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 07d1bc4..9693d40 100644 --- a/README.md +++ b/README.md @@ -81,12 +81,18 @@ Prerequisites: - [Moonlight](https://moonlight-stream.org/) streaming client - [Docker](https://docs.docker.com/engine/install/) (other container engine support will come soon) -Install `cloudypad` CLI: +Install latest version of `cloudypad` CLI: ```sh curl -fsSL https://raw.githubusercontent.com/PierreBeucher/cloudypad/master/install.sh | sh ``` +Living on the edge? Install directly from a branch or a Git commit: + +```sh +curl -fsSL https://raw.githubusercontent.com/PierreBeucher/cloudypad/master/install.sh | CLOUDYPAD_VERSION="master" sh +``` + You may need to setup a few things on your Cloud provider (eg. API key or SSH key). Checkout [per-Clouder setup specifities](#detailed-setup-per-clouder). Once ready, create your instance with `cloudypad` CLI: diff --git a/hack/prepare-release.sh b/hack/prepare-release.sh index 45f7c1e..8487b3d 100755 --- a/hack/prepare-release.sh +++ b/hack/prepare-release.sh @@ -12,7 +12,7 @@ VERSION_REGEX="[0-9]\+\.[0-9]\+\.[0-9]\+\([-a-zA-Z0-9]*\)\?" # Replace CLOUDYPAD_VERSION in cloudypad.sh with any semantic version including those with additional characters sed -i "s/CLOUDYPAD_VERSION=$VERSION_REGEX/CLOUDYPAD_VERSION=$NEW_VERSION/" cloudypad.sh -sed -i "s/CLOUDYPAD_VERSION=$VERSION_REGEX/CLOUDYPAD_VERSION=$NEW_VERSION/" install.sh +sed -i "s/DEFAULT_CLOUDYPAD_VERSION=$VERSION_REGEX/DEFAULT_CLOUDYPAD_VERSION=$NEW_VERSION/" install.sh # Replace version in flake.nix with any semantic version including those with additional characters sed -i "s/version = \"$VERSION_REGEX\";/version = \"$NEW_VERSION\";/" flake.nix diff --git a/install.sh b/install.sh index 3c23f63..0fd9032 100755 --- a/install.sh +++ b/install.sh @@ -4,8 +4,12 @@ set -e # Installation arguments # Override by setting related environment variable +DEFAULT_CLOUDYPAD_VERSION=0.1.1 CLOUDYPAD_HOME=${CLOUDYPAD_HOME:-"$HOME/.cloudypad"} -CLOUDYPAD_VERSION=0.1.0 +CLOUDYPAD_VERSION=${CLOUDYPAD_VERSION:-$DEFAULT_CLOUDYPAD_VERSION} + +echo "Installing Cloudy Pad version $CLOUDYPAD_VERSION" + CLOUDYPAD_SCRIPT_URL="https://raw.githubusercontent.com/PierreBeucher/cloudypad/$CLOUDYPAD_VERSION/cloudypad.sh" # === @@ -33,7 +37,7 @@ chmod 0700 $CLOUDYPAD_HOME mkdir -p "$INSTALL_DIR" if command -v curl >/dev/null 2>&1; then - curl -sSL -o "$SCRIPT_PATH" "$CLOUDYPAD_SCRIPT_URL" + curl --fail -sSL -o "$SCRIPT_PATH" "$CLOUDYPAD_SCRIPT_URL" elif command -v wget >/dev/null 2>&1; then wget -O "$SCRIPT_PATH" "$CLOUDYPAD_SCRIPT_URL" else