From 30ad9c65f0c5fe5ba3ad1c9ad6a928812d604ca1 Mon Sep 17 00:00:00 2001 From: Erik Ostien Date: Fri, 15 Nov 2024 12:57:46 -0700 Subject: [PATCH 1/4] PDI-2080: Update README with Installation Documentation --- .github/workflows/goreleaser.yaml | 2 +- README.md | 48 ++++++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml index 42425522..c67e288e 100644 --- a/.github/workflows/goreleaser.yaml +++ b/.github/workflows/goreleaser.yaml @@ -28,7 +28,7 @@ jobs: # either 'goreleaser' (default) or 'goreleaser-pro' distribution: goreleaser # 'latest', 'nightly', or a semver - version: latest + version: "~> v2" args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index e30732a2..8ad83512 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,53 @@ The Ping CLI is a unified command line interface for configuring and managing Pi ## Install - +#### macOS/Linux - Homebrew + +Use PingIdentity's Homebrew tap to install Ping CLI + +```text +brew install pingidentity/tap/pingcli + +or + +brew tap pingidentity/tap +brew install pingcli +``` + +#### Manual Installation - macOS/Linux + +See [the latest GitHub release](https://github.com/pingidentity/pingcli/releases/latest) for binary downloads and SHA256 checksum files. + +OR + +Use the following single-line command to install Ping CLI directly. + +```text +RELEASE_VERSION=$(basename $(curl -Ls -o /dev/null -w %{url_effective} https://github.com/pingidentity/pingcli/releases/latest)); \ +OS_NAME=$(uname -s); \ +HARDWARE_PLATFORM=$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/); \ +TAR_FILENAME="pingcli.tar.gz"; \ +curl --location --silent --output "${TAR_FILENAME}" --request GET \ +"https://github.com/pingidentity/pingcli/releases/download/${RELEASE_VERSION}/pingcli_${RELEASE_VERSION#v}_${OS_NAME}_${HARDWARE_PLATFORM}.tar.gz"; \ +tar -zxf "${TAR_FILENAME}" pingcli; \ +rm -f "${TAR_FILENAME}" +``` + +#### Manual Installation - Windows + +See [the latest GitHub release](https://github.com/pingidentity/pingcli/releases/latest) for binary downloads and SHA256 checksum files. + +OR + +Use the following single-line powershell command to install Ping CLI directly. +```TEXT +$latestReleaseUrl = Invoke-WebRequest -Uri "https://github.com/pingidentity/pingcli/releases/latest" -MaximumRedirection 0 -ErrorAction Ignore -UseBasicParsing; ` +$RELEASE_VERSION = [System.IO.Path]::GetFileName($latestReleaseUrl.Headers.Location); ` +$RELEASE_VERSION_NO_PREFIX = $RELEASE_VERSION -replace "^v", ""; ` +Invoke-WebRequest -Uri "https://github.com/pingidentity/pingcli/releases/download/${RELEASE_VERSION}/pingcli_${RELEASE_VERSION_NO_PREFIX}_windows_amd64.tar.gz" -OutFile pingcli.tar.gz; ` +tar -zxf pingcli.tar.gz pingcli.exe; ` +Remove-Item pingcli.tar.gz +``` ## Configure Ping CLI From 161b89510eb03bcae5c4bc074307dc57506d8fd8 Mon Sep 17 00:00:00 2001 From: Erik Ostien Date: Fri, 15 Nov 2024 13:03:14 -0700 Subject: [PATCH 2/4] Unify shell and powershell on hardcoded tar filename --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8ad83512..64776006 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,10 @@ Use the following single-line command to install Ping CLI directly. RELEASE_VERSION=$(basename $(curl -Ls -o /dev/null -w %{url_effective} https://github.com/pingidentity/pingcli/releases/latest)); \ OS_NAME=$(uname -s); \ HARDWARE_PLATFORM=$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/); \ -TAR_FILENAME="pingcli.tar.gz"; \ -curl --location --silent --output "${TAR_FILENAME}" --request GET \ +curl --location --silent --output pingcli.tar.gz --request GET \ "https://github.com/pingidentity/pingcli/releases/download/${RELEASE_VERSION}/pingcli_${RELEASE_VERSION#v}_${OS_NAME}_${HARDWARE_PLATFORM}.tar.gz"; \ -tar -zxf "${TAR_FILENAME}" pingcli; \ -rm -f "${TAR_FILENAME}" +tar -zxf pingcli.tar.gz pingcli; \ +rm -f pingcli.tar.gz ``` #### Manual Installation - Windows From d890dd926da249b810edba84202aee1735df7e89 Mon Sep 17 00:00:00 2001 From: Erik Ostien Date: Fri, 15 Nov 2024 13:15:26 -0700 Subject: [PATCH 3/4] Fix powershell error on http status code check despite error ignore --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 64776006..647ca5ee 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ OR Use the following single-line powershell command to install Ping CLI directly. ```TEXT -$latestReleaseUrl = Invoke-WebRequest -Uri "https://github.com/pingidentity/pingcli/releases/latest" -MaximumRedirection 0 -ErrorAction Ignore -UseBasicParsing; ` +$latestReleaseUrl = Invoke-WebRequest -Uri "https://github.com/pingidentity/pingcli/releases/latest" -MaximumRedirection 0 -ErrorAction Ignore -UseBasicParsing -SkipHttpErrorCheck; ` $RELEASE_VERSION = [System.IO.Path]::GetFileName($latestReleaseUrl.Headers.Location); ` $RELEASE_VERSION_NO_PREFIX = $RELEASE_VERSION -replace "^v", ""; ` Invoke-WebRequest -Uri "https://github.com/pingidentity/pingcli/releases/download/${RELEASE_VERSION}/pingcli_${RELEASE_VERSION_NO_PREFIX}_windows_amd64.tar.gz" -OutFile pingcli.tar.gz; ` From 15701768e057143f208297efe354630805f12f46 Mon Sep 17 00:00:00 2001 From: Erik Ostien Date: Mon, 18 Nov 2024 10:57:26 -0700 Subject: [PATCH 4/4] PDI-2080 --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 647ca5ee..f4efc80c 100644 --- a/README.md +++ b/README.md @@ -23,15 +23,15 @@ See [the latest GitHub release](https://github.com/pingidentity/pingcli/releases OR -Use the following single-line command to install Ping CLI directly. +Use the following single-line command to install Ping CLI into '/usr/local/bin' directly. ```text RELEASE_VERSION=$(basename $(curl -Ls -o /dev/null -w %{url_effective} https://github.com/pingidentity/pingcli/releases/latest)); \ OS_NAME=$(uname -s); \ HARDWARE_PLATFORM=$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/); \ -curl --location --silent --output pingcli.tar.gz --request GET \ -"https://github.com/pingidentity/pingcli/releases/download/${RELEASE_VERSION}/pingcli_${RELEASE_VERSION#v}_${OS_NAME}_${HARDWARE_PLATFORM}.tar.gz"; \ -tar -zxf pingcli.tar.gz pingcli; \ +URL="https://github.com/pingidentity/pingcli/releases/download/${RELEASE_VERSION}/pingcli_${RELEASE_VERSION#v}_${OS_NAME}_${HARDWARE_PLATFORM}.tar.gz"; \ +curl -Ls -o pingcli.tar.gz "${URL}"; \ +tar -zxf pingcli.tar.gz -C /usr/local/bin pingcli; \ rm -f pingcli.tar.gz ``` @@ -41,13 +41,16 @@ See [the latest GitHub release](https://github.com/pingidentity/pingcli/releases OR -Use the following single-line powershell command to install Ping CLI directly. -```TEXT +Use the following single-line powershell command to install Ping CLI into '%LOCALAPPDATA%\Programs' directly. +```text $latestReleaseUrl = Invoke-WebRequest -Uri "https://github.com/pingidentity/pingcli/releases/latest" -MaximumRedirection 0 -ErrorAction Ignore -UseBasicParsing -SkipHttpErrorCheck; ` $RELEASE_VERSION = [System.IO.Path]::GetFileName($latestReleaseUrl.Headers.Location); ` $RELEASE_VERSION_NO_PREFIX = $RELEASE_VERSION -replace "^v", ""; ` -Invoke-WebRequest -Uri "https://github.com/pingidentity/pingcli/releases/download/${RELEASE_VERSION}/pingcli_${RELEASE_VERSION_NO_PREFIX}_windows_amd64.tar.gz" -OutFile pingcli.tar.gz; ` -tar -zxf pingcli.tar.gz pingcli.exe; ` +$uname = (uname -m); ` +$HARDWARE_PLATFORM = $uname -replace "aarch64", "arm64" -replace "x86_64", "amd64"; ` +$URL = "https://github.com/pingidentity/pingcli/releases/download/${RELEASE_VERSION}/pingcli_${RELEASE_VERSION_NO_PREFIX}_windows_${HARDWARE_PLATFORM}.tar.gz" +Invoke-WebRequest -Uri $URL -OutFile pingcli.tar.gz; ` +tar -zxf pingcli.tar.gz -C "${env:LOCALAPPDATA}\Programs" pingcli.exe; ` Remove-Item pingcli.tar.gz ```