Files
shpod/helper-curl
Bret Fisher 097e3df462 Merge in upstream refactor for multiplatform awesomesauce (#42)
* Changes stern to point to stern/stern

* ♻️ Update Stern to use stern/stern; get it from the GHCR image; update curl commands

* Update README to mention Bret's fork which supports ARM

* ♻️ Bump up versions and fix krew missing from PATH

Fixes #12

* Add alias k=kubectl + completion

Closes #11

* Update shpod.yaml

Remove `imagePullPolicy`; it will default to `Always` since we're using the `:latest` tag.

* ✏️  Change default editor (for kubectl edit) to vim

*  Update krew install URL

* ⚙️  Add GHA workflow to build+push to GHCR and Docker Hub

* 🏭️ Refactor Dockerfile to log as non-root

Multiple improvements here:
- start a shell with the k8s user instead of root
- when running without a tty, start an SSH server instead of a login shell
- move shell setup to bash_profile instead of Dockerfile
- add a helper script to set up tailhist
- add motd support

*  Add 'tree' and 'kustomize'

*  Upgrade to Compose v2 and add completion for a bunch of tools

* 🔧 Minor fixes and tweaks

*  Add regclient tools (regbot, regctl, regsync)

* 📃 Generate kubeconfig + update docs

*  Add kube-linter

* ♻️  Refactor Dockerfile to leverage BuildKit parallelism

* 🧹 Build httping instead of using a sketchy binary

* 🧹 Move jid version to an env var

* 🏭️ Rewrite Dockerfile to support multi-arch and cross-compilation

*  Add Docker CLI

* ♻️  Move version numbers to their individual build stage for better caching

* 🐞 Fix multi-arch support for krew

* 📃 Update documentation

*  Add crane, ngrok, and skopeo

*  Add yq and switch versions to ARG instead of ENV

Thanks @soulshake for the suggestion!

*  Update kubeseal

* 🐞 Fix kubeconfig download logic

*  Remove fftw (it's huge and doesn't bring much benefit to httping)

* 🐞 Tiny typo fix in motd

*  Add k9s; rollback kubeseal version

* 📃 Add info to install packages in motd

* ✂️  Remove skopeo (it's rarely used and it's juse one 'apk add' away)

*  Add iputils so that ping runs without sudo

* 🔑 Increase MaxAuthTries in SSH for folks with many keys

* push on pr

* auth on pr's

* only latest if on default branch

Co-authored-by: onlinejudge95 <onlinejudge95@gmail.com>
Co-authored-by: Jérôme Petazzoni <jerome.petazzoni@gmail.com>
2022-01-14 17:30:06 -05:00

72 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
set -e
TYPE=$1
BIN_OR_ARGS=$2
URL=$3
case $TARGETARCH in
amd64)
GOARCH=amd64
KSARCH=linux-amd64
UARCH=x86_64
WTFARCH=x86_64
;;
arm64)
GOARCH=arm64
KSARCH=arm64
UARCH=aarch64
WTFARCH=arm64
;;
arm)
GOARCH=arm
KSARCH=arm
UARCH=armv7
WTFARCH=arm
;;
*)
echo "Unsupported architecture: $TARGETARCH."
GOARCH=$TARGETARCH
KSARCH=$TARGETARCH
UARCH=$TARGETARCH
WTFARCH=$TARGETARCH
;;
esac
mangle() {
echo $1 | sed \
-e s/@GOARCH/$GOARCH/g \
-e s/@KSARCH/$KSARCH/g \
-e s/@UARCH/$UARCH/g \
-e s/@WTFARCH/$WTFARCH/g \
#
}
URL=$(mangle $URL)
BIN_OR_ARGS=$(mangle "$BIN_OR_ARGS")
if ! curl -fsSLI $URL >/dev/null; then
echo "URL not found: $URL"
BIN=${BIN_OR_ARGS##*/}
echo "Installing placeholder: $BIN"
cp /bin/helper-unsupported /usr/local/bin/$BIN
exit 0
fi
case "$TYPE" in
bin)
BIN=$BIN_OR_ARGS
curl -fsSL $URL > /usr/local/bin/$BIN
chmod +x /usr/local/bin/$BIN
;;
tar)
ARGS=$BIN_OR_ARGS
curl -fsSL $URL | tar -zxvf- -C /usr/local/bin $ARGS
;;
*)
echo "Unrecognized download type: $TYPE"
exit 1
;;
esac