| Giorgi Lekveishvili | 1c09e60 | 2020-12-17 16:03:42 +0400 | [diff] [blame^] | 1 | #!/bin/bash |
| giolekva | c32dd31 | 2020-12-17 15:50:12 +0400 | [diff] [blame] | 2 | |
| 3 | function check() { |
| 4 | name=$1 |
| 5 | installation_instructions=$2 |
| 6 | echo "Checking $name" |
| 7 | if ! command -v $name &> /dev/null |
| 8 | then |
| 9 | echo " Please make sure you have it installed and can be found in the PATH." |
| 10 | echo " Installation instructions can be found at: $installation_instructions" |
| 11 | return 1 |
| 12 | else |
| 13 | echo " Found" |
| 14 | return 0 |
| 15 | fi |
| 16 | } |
| 17 | |
| 18 | missing=0 |
| 19 | check "python" "https://www.python.org/downloads/" |
| 20 | missing=$((missing + $?)) |
| 21 | check "bazel" "https://docs.bazel.build/versions/3.7.0/install.html" |
| 22 | missing=$((missing + $?)) |
| 23 | check "docker" "https://k3d.io/#installation" |
| 24 | missing=$((missing + $?)) |
| 25 | check "k3d" "https://k3d.io/#installation" |
| 26 | missing=$((missing + $?)) |
| 27 | check "kubectl" "https://kubectl.docs.kubernetes.io/installation/kubectl/" |
| 28 | missing=$((missing + $?)) |
| 29 | check "helm" "https://helm.sh/docs/intro/install/" |
| 30 | missing=$((missing + $?)) |
| 31 | |
| 32 | if (( $missing > 0 )) |
| 33 | then |
| 34 | echo "Some of the requirements are missing, please see instructions on how to install them above." |
| 35 | exit 1 |
| 36 | else |
| 37 | echo "All requirements met." |
| 38 | fi |