b1af3af5de6eb38ecf48f5f9ad3bcc4d1e7c1a98
[eliot.git] / blueprints / iotgateway / scripts / edgex / verifyedgex.sh
1 #!/bin/bash -ex
2
3 ##############################################################################
4 # Copyright (c) 2019 Huawei Tech and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
11
12 # To verify edgex platform deployment on k8s.
13
14 retrytimes=10
15 while [ $retrytimes -gt 0 ]
16 do
17  if [ 1 == "$(kubectl get pods | grep edgex-config-seed | grep -i completed | wc -l)" ]; then
18     break
19  fi
20  ((retrytimes-=1))
21  sleep 5
22 done
23 [ $retrytimes -gt 0 ] || exit 1
24
25 # Reset the variable to check Running status of other edgex platform microservices
26
27 retrytimes=20
28 while [ $retrytimes -gt 0 ]
29 do
30  if [ 12 == "$(kubectl get pods | grep edgex | grep Running | wc -l)" ]; then
31     echo "Edgex Platform is successfully deployed on ELIOT !!!!"
32     break
33  fi
34  ((retrytimes-=1))
35  sleep 5
36 done
37 [ $retrytimes -gt 0 ] || exit 1
38