Skip to content

Commit

Permalink
feat(install): go and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ant0wan committed Mar 1, 2024
1 parent 8a03f37 commit b8a59ab
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
30 changes: 13 additions & 17 deletions tools/go.install.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
#!/bin/sh
set -o errexit
#script_dir=$(dirname "$0")
#. "$script_dir/git.install.sh"
#rm -rf /usr/local/go
#VERSIONS=$(git ls-remote --tags https://go.googlesource.com/go | awk -F '/' '{print $3}')
#VERSION='go1.22.0'


wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz -O /tmp/
wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz -O /tmp/
#tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz

VERSION=$(
select VERSION in $(git ls-remote --tags https://go.googlesource.com/go | awk -F '/' '{print $3}'); do
echo $VERSION;
break;
done)
printf "\r$VERSION\n"
SCRIPTNAME="$(basename "$0")"
BIN="${SCRIPTNAME%.install.sh}"
TMP="/tmp/${BIN}_${VERSION}"
OS="$(uname -s | awk '{print tolower($0)}')"
ARCH="$(uname -m | sed 's/x86_64/amd64/')"
OS="$(uname -s)"
TARGET="tofu_${LATEST}_${OS}_${ARCH}.zip"
TMP="/tmp/tofu_${LATEST}"
TARGET="${VERSION}.${OS}-${ARCH}.tar.gz"
mkdir -p "$TMP"
sudo wget "https://github.com/opentofu/opentofu/releases/latest/download/tofu_${LATEST}_${OS}_${ARCH}.zip" -O "${TMP}/${TARGET}"
sudo unzip "${TMP}/${TARGET}" tofu -d /usr/local/bin/
sudo chmod +x /usr/local/bin/tofu
wget "https://go.dev/dl/${VERSION}.${OS}-${ARCH}.tar.gz" -O "${TMP}/${TARGET}"
sudo tar -C "/usr/local" -xzf "${TMP}/${TARGET}"
2 changes: 1 addition & 1 deletion tools/kubectl.install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -o errexit
VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
SCRIPTNAME="$(basename "$0")"
BIN="${SCRIPTNAME%.install.sh}"
TMP="/tmp/${BIN}_${LATEST}"
TMP="/tmp/${BIN}_${VERSION}"
OS="$(uname -s | awk '{print tolower($0)}')"
ARCH="$(uname -m | sed 's/x86_64/amd64/')"
URL="https://dl.k8s.io/release/${VERSION}/bin/${OS}/${ARCH}/kubectl"
Expand Down
1 change: 1 addition & 0 deletions tools/python.install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
set -o errexit
VERSION='3.11'
if /usr/bin/python --version | grep $VERSION; then
echo "Python already installed."
Expand Down
2 changes: 1 addition & 1 deletion tools/trivy.install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -o errexit
VERSION=$(curl -s "https://api.github.com/repos/aquasecurity/trivy/releases/latest" | jq -r '.tag_name')
SCRIPTNAME="$(basename "$0")"
BIN="${SCRIPTNAME%.install.sh}"
TMP="/tmp/${BIN}_${LATEST}"
TMP="/tmp/${BIN}_${VERSION}"
OS="$(uname -s)"
TARGET="trivy_${VERSION:1}_${OS}-64bit.deb"
mkdir -p "$TMP"
Expand Down

0 comments on commit b8a59ab

Please sign in to comment.