Add check_requirements script checking all required dependencies #35
diff --git a/dev/check_requirements.sh b/dev/check_requirements.sh
new file mode 100755
index 0000000..e679ef4
--- /dev/null
+++ b/dev/check_requirements.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+function check() {
+ name=$1
+ installation_instructions=$2
+ echo "Checking $name"
+ if ! command -v $name &> /dev/null
+ then
+ echo " Please make sure you have it installed and can be found in the PATH."
+ echo " Installation instructions can be found at: $installation_instructions"
+ return 1
+ else
+ echo " Found"
+ return 0
+ fi
+}
+
+missing=0
+check "python" "https://www.python.org/downloads/"
+missing=$((missing + $?))
+check "bazel" "https://docs.bazel.build/versions/3.7.0/install.html"
+missing=$((missing + $?))
+check "docker" "https://k3d.io/#installation"
+missing=$((missing + $?))
+check "k3d" "https://k3d.io/#installation"
+missing=$((missing + $?))
+check "kubectl" "https://kubectl.docs.kubernetes.io/installation/kubectl/"
+missing=$((missing + $?))
+check "helm" "https://helm.sh/docs/intro/install/"
+missing=$((missing + $?))
+
+if (( $missing > 0 ))
+then
+ echo "Some of the requirements are missing, please see instructions on how to install them above."
+ exit 1
+else
+ echo "All requirements met."
+fi
diff --git a/docs/dev.md b/docs/dev.md
index b858ebe..b8b2420 100644
--- a/docs/dev.md
+++ b/docs/dev.md
@@ -2,12 +2,18 @@
## Prerequisites
PCloud uses following tools to build and deploy it's packages:
+* Python - Used by Bazel: https://www.python.org/downloads/
+* Bazel - Build tool of the: https://docs.bazel.build/versions/3.7.0/install.html
* Docker - To build container images: https://docs.docker.com/get-docker/
* k3d - To create local Kubernetes cluster for development environment: https://k3d.io/#installation
* kubectl - To interacto with the cluster: https://kubectl.docs.kubernetes.io/installation/kubectl/
* Helm - To package and distributes both PCloud core services and applications running on it: https://helm.sh/docs/intro/install/
Each of these tools provide multiple ways of installing them, choose the one which best suits you and your Host OS.
+To check if requirements are met please run:
+```shell
+> ./dev/check_requirements.sh
+```
# Development Instructions