Skip to content

Commit

Permalink
add workflow to test CLI installer (#1061)
Browse files Browse the repository at this point in the history
  • Loading branch information
schoren authored Aug 12, 2022
1 parent 2eab071 commit c717ea4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/pull-request-installer.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 6 additions & 3 deletions install-cli.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

cmd_exists() {
command -v $1 &> /dev/null
Expand Down Expand Up @@ -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"
;;
Expand All @@ -37,7 +40,7 @@ get_arch() {
;;

*)
echo ""
echo $arch
;;
esac
}
Expand Down

0 comments on commit c717ea4

Please sign in to comment.