mirror of
https://github.com/rwxrob/dot
synced 2024-11-16 21:25:29 +00:00
Add install-etcd
This commit is contained in:
parent
4baf471968
commit
05f402a2b1
29
install/ubuntu/install-etcd
Executable file
29
install/ubuntu/install-etcd
Executable file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
echo "Are you absolutely sure you want to install the *latest* etcd"
|
||||
echo "(which may not be the same as the one for your Kubernetes version)."
|
||||
read -p "(y/N) " response
|
||||
test "$response" = "y"
|
||||
|
||||
user="etcd-io"
|
||||
repo="etcd"
|
||||
|
||||
os=$(uname -s)
|
||||
arch=$(uname -m)
|
||||
[[ "$arch" == x86_64 ]] && arch=amd64
|
||||
|
||||
latest=$(curl -sSL "https://api.github.com/repos/$user/$repo/releases/latest" | jq -r .name)
|
||||
rel="https://github.com/$user/$repo/releases/download/$latest/${repo}-${latest}-${os,,}-${arch}.tar.gz"
|
||||
|
||||
dir=$(mktemp -d)
|
||||
curl -L "$rel" -o "$dir/$repo.tar.gz"
|
||||
cd "$dir"
|
||||
tar xzf "$repo.tar.gz"
|
||||
|
||||
echo "Do you want to move the following into /usr/local/bin?"
|
||||
ls -l $repo-$latest*/etcd*
|
||||
read -p "(y/N) " response
|
||||
test "$response" = "y"
|
||||
sudo mv $repo-$latest*/etcd* /usr/local/bin
|
||||
rm -rf "$dir"
|
Loading…
Reference in New Issue
Block a user