File tree Expand file tree Collapse file tree 5 files changed +62
-11
lines changed
Expand file tree Collapse file tree 5 files changed +62
-11
lines changed Original file line number Diff line number Diff line change 3838
3939 - name : Install Chainsaw
4040 shell : bash
41- run : go install github.com/kyverno/chainsaw@${{ inputs.chainsaw_version }}
41+ run : |
42+ set -euo pipefail
43+ VERSION="${{ inputs.chainsaw_version }}"
44+ VERSION="${VERSION#v}"
45+ TAR="chainsaw_linux_amd64.tar.gz"
46+ URL="https://github.com/kyverno/chainsaw/releases/download/v${VERSION}/${TAR}"
47+ TMP="$(mktemp -d)"
48+ curl -fsSL -o "${TMP}/${TAR}" "${URL}"
49+ tar -xzf "${TMP}/${TAR}" -C "${TMP}"
50+ sudo mv "${TMP}/chainsaw" /usr/local/bin/chainsaw
51+ sudo chmod +x /usr/local/bin/chainsaw
52+ rm -rf "${TMP}"
53+ chainsaw version
4254
4355 - name : Build aicr binary
4456 shell : bash
Original file line number Diff line number Diff line change 7272 - name : Install Chainsaw
7373 shell : bash
7474 run : |
75- go install github.com/kyverno/chainsaw@${{ inputs.chainsaw_version }}
75+ set -euo pipefail
76+ VERSION="${{ inputs.chainsaw_version }}"
77+ VERSION="${VERSION#v}"
78+ TAR="chainsaw_linux_amd64.tar.gz"
79+ URL="https://github.com/kyverno/chainsaw/releases/download/v${VERSION}/${TAR}"
80+ TMP="$(mktemp -d)"
81+ curl -fsSL -o "${TMP}/${TAR}" "${URL}"
82+ tar -xzf "${TMP}/${TAR}" -C "${TMP}"
83+ sudo mv "${TMP}/chainsaw" /usr/local/bin/chainsaw
84+ sudo chmod +x /usr/local/bin/chainsaw
85+ rm -rf "${TMP}"
86+ chainsaw version
7687
7788 - name : Run Integration Tests
7889 shell : bash
Original file line number Diff line number Diff line change @@ -115,8 +115,17 @@ jobs:
115115
116116 - name : Install chainsaw
117117 run : |
118- CHAINSAW_VERSION=$(yq eval '.testing_tools.chainsaw' .settings.yaml)
119- GOFLAGS= go install "github.com/kyverno/chainsaw@${CHAINSAW_VERSION}"
118+ set -euo pipefail
119+ VERSION=$(yq eval '.testing_tools.chainsaw' .settings.yaml)
120+ VERSION="${VERSION#v}"
121+ TAR="chainsaw_linux_amd64.tar.gz"
122+ URL="https://github.com/kyverno/chainsaw/releases/download/v${VERSION}/${TAR}"
123+ TMP="$(mktemp -d)"
124+ curl -fsSL -o "${TMP}/${TAR}" "${URL}"
125+ tar -xzf "${TMP}/${TAR}" -C "${TMP}"
126+ sudo mv "${TMP}/chainsaw" /usr/local/bin/chainsaw
127+ sudo chmod +x /usr/local/bin/chainsaw
128+ rm -rf "${TMP}"
120129 chainsaw version
121130
122131 - name : Run chainsaw health checks
Original file line number Diff line number Diff line change 9696
9797 - name : Install chainsaw
9898 run : |
99- CHAINSAW_VERSION=$(yq eval '.testing_tools.chainsaw' .settings.yaml)
100- GOFLAGS= go install "github.com/kyverno/chainsaw@${CHAINSAW_VERSION}"
99+ set -euo pipefail
100+ VERSION=$(yq eval '.testing_tools.chainsaw' .settings.yaml)
101+ VERSION="${VERSION#v}"
102+ TAR="chainsaw_linux_amd64.tar.gz"
103+ URL="https://github.com/kyverno/chainsaw/releases/download/v${VERSION}/${TAR}"
104+ TMP="$(mktemp -d)"
105+ curl -fsSL -o "${TMP}/${TAR}" "${URL}"
106+ tar -xzf "${TMP}/${TAR}" -C "${TMP}"
107+ sudo mv "${TMP}/chainsaw" /usr/local/bin/chainsaw
108+ sudo chmod +x /usr/local/bin/chainsaw
109+ rm -rf "${TMP}"
101110 chainsaw version
102111
103112 - name : Run chainsaw health checks
Original file line number Diff line number Diff line change @@ -365,11 +365,21 @@ if [[ "${SKIP_TOOLS}" == "false" ]]; then
365365 else
366366 log_info " Installing Chainsaw ${CHAINSAW_VERSION} ..."
367367 if prompt_continue; then
368- if command_exists go; then
369- go install github.com/kyverno/chainsaw@" ${CHAINSAW_VERSION} "
370- else
371- log_warning " Install chainsaw manually: go install github.com/kyverno/chainsaw@${CHAINSAW_VERSION} "
372- fi
368+ local ver=" ${CHAINSAW_VERSION# v} "
369+ local os_name; os_name=" $( uname -s | tr ' [:upper:]' ' [:lower:]' ) "
370+ local arch; arch=" $( uname -m) "
371+ case " ${arch} " in
372+ x86_64) arch=" amd64" ;;
373+ aarch64|arm64) arch=" arm64" ;;
374+ esac
375+ local tar=" chainsaw_${os_name} _${arch} .tar.gz"
376+ local url=" https://github.com/kyverno/chainsaw/releases/download/v${ver} /${tar} "
377+ local tmp; tmp=" $( mktemp -d) "
378+ curl -fsSL -o " ${tmp} /${tar} " " ${url} "
379+ tar -xzf " ${tmp} /${tar} " -C " ${tmp} "
380+ sudo mv " ${tmp} /chainsaw" /usr/local/bin/chainsaw
381+ sudo chmod +x /usr/local/bin/chainsaw
382+ rm -rf " ${tmp} "
373383 log_success " Chainsaw installed"
374384 fi
375385 fi
You can’t perform that action at this time.
0 commit comments