21293e4c06b7660cb852d11fe4f10f75aeedf47c
[icn.git] / deploy / clusterctl / clusterctl.sh
1 #!/usr/bin/env bash
2 set -eux -o pipefail
3
4 SCRIPTDIR="$(readlink -f $(dirname ${BASH_SOURCE[0]}))"
5 LIBDIR="$(dirname $(dirname ${SCRIPTDIR}))/env/lib"
6
7 source $LIBDIR/common.sh
8
9 function deploy {
10     curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/${CAPI_VERSION}/clusterctl-linux-amd64 -o clusterctl
11     sudo install -o root -g root -m 0755 clusterctl /usr/local/bin/clusterctl
12     rm clusterctl
13     clusterctl version
14 }
15
16 case $1 in
17     "deploy") deploy ;;
18     *) cat <<EOF
19 Usage: $(basename $0) COMMAND
20
21 Commands:
22   deploy        - Deploy clusterctl
23 EOF
24        ;;
25 esac