|
16 | 16 | # specific language governing permissions and limitations |
17 | 17 | # under the License. |
18 | 18 | # |
19 | | -sudo sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin |
| 19 | +cd $HOME |
20 | 20 | sudo apt-get -y install curl wget jq |
21 | | -WSK_VERSION=1.2.0 |
22 | | -WSK_BASE=https://github.com/apache/openwhisk-cli/releases/download |
23 | | -ARCH=amd64 |
24 | | -WSK_URL="$WSK_BASE/$WSK_VERSION/OpenWhisk_CLI-$WSK_VERSION-linux-$ARCH.tgz" |
25 | | -curl -sSL https://install.python-poetry.org | python3.12 - |
26 | | -curl -sSL "$WSK_URL" | tar xzvf - -C ~/.local/bin/ |
27 | | -VER="v4.5.4" |
28 | | -ARCH="$(dpkg --print-architecture)" |
29 | | -URL="https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F$VER/kustomize_${VER}_linux_${ARCH}.tar.gz" |
30 | | -curl -sL $URL | tar tzvf - -C ~/.local/bin |
31 | | -YQ_VER=v4.27.2 |
32 | | -YQ_BIN=yq_linux_amd64 |
33 | | -sudo wget https://github.com/mikefarah/yq/releases/download/${YQ_VER}/${YQ_BIN} -O /usr/bin/yq && sudo chmod +x /usr/bin/yq |
34 | | -MC_VER=RELEASE.2025-05-21T01-59-54Z |
35 | | -sudo wget https://dl.min.io/client/mc/release/linux-${ARCH}/archive/mc.${MC_VER} -O /usr/bin/mc && sudo chmod +x /usr/bin/mc |
36 | | -#URL="https://dl.k8s.io/release/$VER/bin/linux/$ARCH/kubectl" |
37 | | -#curl -sSL "$URL" | sudo tee /usr/local/bin/kubectl && sudo chmod +x /usr/bin/kubectl |
38 | | -#kubectl version |
| 21 | +# ensure local bin exists and is on PATH for this script |
| 22 | +mkdir -p "$HOME/.local/bin" |
| 23 | +export PATH="$HOME/.local/bin:$PATH" |
| 24 | + |
| 25 | +# add ops bin (~/.ops/<os>-<arch>/bin). os is uname -s lowercase, map common arch names |
| 26 | +os="$(uname -s | tr '[:upper:]' '[:lower:]')" |
| 27 | +arch="$(uname -m)" |
| 28 | +case "$arch" in |
| 29 | + x86_64) arch=amd64 ;; |
| 30 | + aarch64|arm64) arch=arm64 ;; |
| 31 | + armv7l) arch=armv7 ;; |
| 32 | + i386|i686) arch=386 ;; |
| 33 | +esac |
| 34 | +RESOLVED_OPS_BIN="$HOME/.ops/${os}-${arch}/bin" |
| 35 | + |
| 36 | +# install ops, wsk wrapper and task |
| 37 | +VER="0.1.0-2501041342.dev";\ |
| 38 | +URL="https://raw.githubusercontent.com/apache/openserverless-cli/refs/tags/v$VER/install.sh" ;\ |
| 39 | +curl -sL $URL | VERSION="$VER" bash ;\ |
| 40 | +echo -e '#!/bin/bash\nops -wsk "$@"' >$HOME/.local/bin/wsk ; chmod +x $HOME/.local/bin/wsk ;\ |
| 41 | +curl -sL https://taskfile.dev/install.sh | sh -s -- -d -b $HOME/.local/bin; \ |
| 42 | +task --version && ops -t |
| 43 | + |
| 44 | +# Persist ops path for GitHub Actions steps |
| 45 | +echo "$RESOLVED_OPS_BIN" >> "$GITHUB_PATH" |
| 46 | +echo "$HOME/.local/bin" >> "$GITHUB_PATH" |
0 commit comments