Skip to content

Commit

Permalink
Improved output
Browse files Browse the repository at this point in the history
  • Loading branch information
mmontes11 committed May 12, 2024
1 parent ff8c221 commit c2a2472
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 32 deletions.
10 changes: 3 additions & 7 deletions k9s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ if [ -z $ARCH ]; then
exit 1
fi

# yq
echo "Installing yq..."

log "Installing yq..."
YQ_VERSION=${YQ_VERSION:-v4.43.1}
YQ_URL=https://github.com/mikefarah/yq/releases/download/$YQ_VERSION/yq_linux_$ARCH

Expand All @@ -24,9 +22,7 @@ else
echo "yq is already installed"
fi

# k9s
echo "🐶 Installing k9s..."

log "Installing k9s..."
K9S_CONFIG=${XDG_CONFIG_HOME:="$USER_HOME/.config/k9s"}
K9S_CTX=${XDG_DATA_HOME:="$USER_HOME/.local/share/k9s"}
echo "Config folder: $K9S_CONFIG"
Expand Down Expand Up @@ -98,4 +94,4 @@ cp -r .k9s/clusters/* "$K9S_CTX/clusters"
chown -R "$USER:$USER" "$K9S_CONFIG"
chown -R "$USER:$USER" "$K9S_CTX"

echo "🐶 Done!"
log "Done!"
33 changes: 17 additions & 16 deletions kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,76 +11,77 @@ if [ -z $ARCH ]; then
exit 1
fi

# kubectl
log "Installing kubectl..."
KUBECTL_VERSION=${KUBECTL_VERSION:-v1.30.0}
KUBECTL_URL=https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/$ARCH/kubectl
install_bin kubectl $KUBECTL_URL

# helm
log "Installing helm..."
HELM_VERSION=${HELM_VERSION:-v3.14.4}
HELM_URL=https://get.helm.sh/helm-$HELM_VERSION-linux-$ARCH.tar.gz
install_tar helm $HELM_URL linux-$ARCH

# kubectx + kubens
log "Installing kubectx + kubens..."
KUBECTX_VERSION=${KUBECTX_VERSION:-v0.9.5}
KUBECTX_URL=https://github.com/ahmetb/kubectx/releases/download/$KUBECTX_VERSION/kubectx
install_bin kubectx $KUBECTX_URL
KUBENS_URL=https://github.com/ahmetb/kubectx/releases/download/$KUBECTX_VERSION/kubens
install_bin kubens $KUBENS_URL

# kind
log "Installing kind..."
KIND_VERSION=${KIND_VERSION:-v0.22.0}
KIND_URL=https://kind.sigs.k8s.io/dl/$KIND_VERSION/kind-linux-$ARCH
install_bin kind $KIND_URL

# kustomize
log "Installing kustomize..."
KUSMTOMIZE_URL=${KUSMTOMIZE_URL:-https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.4.1/kustomize_v5.4.1_linux_$ARCH.tar.gz}
install_tar kustomize $KUSMTOMIZE_URL

# kubebuilder
log "Installing kubebuilder..."
KUBEBUILDER_VERSION=${KUBEBUILDER_VERSION:-v3.14.2}
KUBEBUILDER_URL=https://github.com/kubernetes-sigs/kubebuilder/releases/download/$KUBEBUILDER_VERSION/kubebuilder_linux_$ARCH
install_bin kubebuilder $KUBEBUILDER_URL

# cilium
log "Installing cilium..."
CILIUM_VERSION=${CILIUM_VERSION:-v0.16.7}
CILIUM_URL=${CILIUM_URL:-https://github.com/cilium/cilium-cli/releases/download/$CILIUM_VERSION/cilium-linux-$ARCH.tar.gz}
install_tar cilium $CILIUM_URL

# flux
log "Installing flux..."
FLUX_VERSION=${FLUX_VERSION:-2.2.3}
FLUX_URL=https://github.com/fluxcd/flux2/releases/download/v${FLUX_VERSION}/flux_${FLUX_VERSION}_linux_$ARCH.tar.gz
install_tar flux $FLUX_URL

# cert-manager
log "Installing cmctl..."
CM_VERSION=${CM_VERSION:-v1.14.5}
CM_URL=https://github.com/cert-manager/cert-manager/releases/download/$CM_VERSION/cert-manager-cmctl-linux-$ARCH.tar.gz
install_tar cmctl $CM_URL

# kubeseal
log "Installing kubeseal..."
KUBESEAL_VERSION=${KUBESEAL_VERSION:-0.26.2}
KUBESEAL_URL=https://github.com/bitnami-labs/sealed-secrets/releases/download/v$KUBESEAL_VERSION/kubeseal-$KUBESEAL_VERSION-linux-$ARCH.tar.gz
install_tar kubeseal $KUBESEAL_URL

# vcluster
log "Installing vcluster..."
VCLUSTER_VERSION=${VCLUSTER_VERSION:-v0.19.5}
VCLUSTER_URL=https://github.com/loft-sh/vcluster/releases/download/$VCLUSTER_VERSION/vcluster-linux-$ARCH
install_bin vcluster $VCLUSTER_URL

# mc
log "Installing mc..."
MC_URL=https://dl.min.io/client/mc/release/linux-$ARCH/mc
install_bin mc $MC_URL

# talos
log "Installing talosctl..."
TALOS_VERSION=${TALOS_VERSION:-v1.7.1}
TALOS_URL=https://github.com/siderolabs/talos/releases/download/$TALOS_VERSION/talosctl-linux-$ARCH
echo $TALOS_URL
install_bin talosctl $TALOS_URL

# yq
log "Installing yq..."
YQ_VERSION=${YQ_VERSION:-v4.43.1}
YQ_URL=https://github.com/mikefarah/yq/releases/download/$YQ_VERSION/yq_linux_$ARCH
install_bin yq $YQ_URL

# k9s
source <(curl -s https://raw.githubusercontent.com/mmontes11/k8s-scripts/main/k9s.sh) -y
source <(curl -s https://raw.githubusercontent.com/mmontes11/k8s-scripts/main/k9s.sh) -y

log "Done!"
12 changes: 8 additions & 4 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ set -eo pipefail
function install_bin() {
BIN=$1
URL=$2
echo "Installing binary '$BIN'"
echo "Installing binary '$BIN'..."
echo "Getting release from '$URL'..."

curl -Lo $BIN $URL
curl -sSLo $BIN $URL
chmod +x $BIN
mv $BIN /usr/local/bin/$BIN
}
Expand All @@ -17,10 +17,10 @@ function install_tar() {
BIN=$1
URL=$2
TAR_DIR=$3
echo "Installing binary '$BIN' from tar.gz"
echo "Installing binary '$BIN' from tar.gz..."
echo "Getting release from '$URL'..."

curl -Lo $BIN $URL
curl -sSLo $BIN $URL
mkdir -p /tmp/$BIN
tar -C /tmp/$BIN -zxvf $BIN

Expand Down Expand Up @@ -58,4 +58,8 @@ function get_architecture() {
else
echo ""
fi
}

function log() {
echo "🧰 $1"
}
12 changes: 7 additions & 5 deletions openshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,25 @@ if [ -z $ARCH ]; then
exit 1
fi

# openshift-local
log "Installing openshift-local..."
CRC_VERSION=2.29.0
CRC_URL=https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/$CRC_VERSION/crc-linux-$ARCH.tar.xz
curl -Lo /tmp/crc.tar.xz $CRC_URL
tar -C /tmp -xvf /tmp/crc.tar.xz
mv /tmp/crc-linux-$CRC_VERSION-$ARCH/crc /usr/local/bin
chmod +x /usr/local/bin/crc

# oc
log "Installing oc..."
OC_URL=https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable-4.15/openshift-client-linux-4.15.11.tar.gz
install_tar oc $OC_URL

# opm
log "Installing opm..."
OPM_URL=https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable-4.15/opm-linux-4.15.11.tar.gz
install_tar opm $OPM_URL

# operator-sdk
log "Installing operator-sdk..."
OPERATOR_SDK_VERSION=${OPERATOR_SDK_VERSION:-v1.34.1}
OPERATOR_SDK_URL=https://github.com/operator-framework/operator-sdk/releases/download/$OPERATOR_SDK_VERSION/operator-sdk_linux_$ARCH
install_bin operator-sdk $OPERATOR_SDK_URL
install_bin operator-sdk $OPERATOR_SDK_URL

log "Done!"

0 comments on commit c2a2472

Please sign in to comment.