Merge pull request #9 from giolekva/dev-dgraph

Dev dgraph: install dgraph before core services

#7 
diff --git a/apps/dgraph/setup.sh b/apps/dgraph/install.sh
old mode 100644
new mode 100755
similarity index 73%
rename from apps/dgraph/setup.sh
rename to apps/dgraph/install.sh
index a506dfa..0e6e448
--- a/apps/dgraph/setup.sh
+++ b/apps/dgraph/install.sh
@@ -1,3 +1,5 @@
+#!/bin/sh
+
 kubectl create namespace dgraph
 helm repo add dgraph https://charts.dgraph.io
 helm --namespace=dgraph install init dgraph/dgraph \
@@ -12,3 +14,8 @@
      --set alpha.persistence.size=1Gi \
      --set alpha.persistence.storageClass=local-path \
      --set alpha.configFile."config\.yaml"="whitelist: '0.0.0.0:255.255.255.255'"
+
+echo "Waiting for dgraph-alpha to start"
+kubectl -n dgraph wait --for=condition=Ready pod/dgraph-alpha-0
+echo "Waiting for dgraph-zero to start"
+kubectl -n dgraph wait --for=condition=Ready pod/dgraph-zero-0
diff --git a/dev/install_core_services.sh b/dev/install_core_services.sh
index 09e72dd..c2d9a49 100755
--- a/dev/install_core_services.sh
+++ b/dev/install_core_services.sh
@@ -1,5 +1,9 @@
+#!/bin/sh
+
 ROOT="$(dirname -- $(pwd))"
 
+sh $ROOT/apps/dgraph/install.sh
+
 # Knowledge Graph
 cd "$ROOT/controller"
 docker build --tag=localhost:30500/giolekva/pcloud-api-server .