Skip to content

Commit

Permalink
Merge pull request #547 from ashangit/dependency_deployment
Browse files Browse the repository at this point in the history
scripts: add support for arch linux on install dependencies
  • Loading branch information
zimnx authored Apr 28, 2021
2 parents 027bfc2 + 0faf3b0 commit 631bade
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ set -euExo pipefail

debian_packages=(
ca-certificates
etcd
git
make
)

fedora_packages=(
etcd
git-core
golang-bin
make
Expand All @@ -39,11 +37,22 @@ fedora_packages=(
moby-engine
)

arch_packages=(
git
make
go
)

if [ "$ID" = "fedora" ]
then
sudo dnf install -y "${fedora_packages[@]}"
fi

if [ "$ID" = "arch" ]
then
sudo pacman -S --noconfirm --needed "${arch_packages[@]}"
fi

if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]
then
# If someone has a non-system installation of go, just use that.
Expand All @@ -63,8 +72,11 @@ fi

go install sigs.k8s.io/controller-tools/cmd/[email protected]

mkdir -p tmp
cd tmp
GOPATH="$(go env GOPATH)"
TMPDIR="$(mktemp -d)"
trap 'rm -rf "$TMPDIR"' EXIT

cd "$TMPDIR"

# Kubernetes commands don't work with "go get"
# https://github.com/kubernetes/kubernetes/issues/79384
Expand All @@ -73,11 +85,13 @@ cd kubernetes
# v1.19.x requires go 1.15.0
git checkout v1.18.9
make WHAT=cmd/kube-apiserver
cp _output/bin/kube-apiserver $(go env GOPATH)/bin
cd ..

cp _output/bin/kube-apiserver "$GOPATH"/bin
cd ..
rm -rf tmp

# KUBEBUILDER_ASSETS has to be a single directory
cp /usr/bin/etcd $(go env GOPATH)/bin
# Build etcd
git clone https://github.com/etcd-io/etcd.git
cd etcd
git checkout v3.4.15
go mod vendor
./build
cp ./bin/etcd "$GOPATH"/bin

0 comments on commit 631bade

Please sign in to comment.