From c717ea4bdc007f53fd928a7aceda4843f472ee5a Mon Sep 17 00:00:00 2001 From: Sebastian Choren Date: Fri, 12 Aug 2022 11:57:58 -0300 Subject: [PATCH] add workflow to test CLI installer (#1061) --- .github/workflows/pull-request-installer.yaml | 34 +++++++++++++++++++ docs/installing.md | 2 +- install-cli.sh | 9 +++-- 3 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/pull-request-installer.yaml diff --git a/.github/workflows/pull-request-installer.yaml b/.github/workflows/pull-request-installer.yaml new file mode 100644 index 0000000000..9472f026f5 --- /dev/null +++ b/.github/workflows/pull-request-installer.yaml @@ -0,0 +1,34 @@ +name: Installer Pull Request +on: [push] + +jobs: + linux: + name: Linux + strategy: + matrix: + distro: [ubuntu, fedora, alpine] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: ${{ matrix.distro }} + uses: addnab/docker-run-action@v3 + with: + image: ${{matrix.distro}} + options: -v ${{ github.workspace }}:/app -e GITHUB_SHA + run: | + case "${{ matrix.distro }}" in + ubuntu) + apt-get update -q -y + apt-get install -q -y curl + ;; + fedora) + yum install -y curl --refresh + ;; + alpine) + apk add --update curl + ;; + esac + + curl -L https://raw.githubusercontent.com/kubeshop/tracetest/${GITHUB_SHA}/install-cli.sh | sh + tracetest diff --git a/docs/installing.md b/docs/installing.md index 1148f6aabb..f0cccb1eab 100644 --- a/docs/installing.md +++ b/docs/installing.md @@ -101,7 +101,7 @@ You can find the latest version [here](https://github.com/kubeshop/tracetest/rel Tracetest CLI can be installed automatically using the following script: ```sh -curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash +curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | sh ``` It works for systems with Hombrew, `apt-get`, `dpkg`, `yum`, `rpm` installed, and if no package manager is available, it will try to download the build and install it manually. diff --git a/install-cli.sh b/install-cli.sh index 34a6d85ea6..2f246f2b4c 100755 --- a/install-cli.sh +++ b/install-cli.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh cmd_exists() { command -v $1 &> /dev/null @@ -27,7 +27,10 @@ get_os() { get_arch() { arch=$(uname -p) - case "$arch" in + if [ "$arch" = "unknown" ]; then + arch=$(uname -m) + fi + case "$arch" in "x86_64") echo "amd64" ;; @@ -37,7 +40,7 @@ get_arch() { ;; *) - echo "" + echo $arch ;; esac }