Move plugin upload to CM container
[dcaegen2/deployments.git] / cm-container / scripts / readiness-check.sh
1 #!/bin/bash
2 # ============LICENSE_START=======================================================
3 # org.onap.dcae
4 # ================================================================================
5 # Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved.
6 # ================================================================================
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 # ============LICENSE_END=========================================================
19 #
20 # Check whether Cloudify Manager is ready to take traffic
21 # Two conditions must be met:
22 #    -- The import resolver rules must have been updated.
23 #       This is indicated by the presence of the file named
24 #       /opt/manager/extra-resolver-rules-loaded.
25 #    -- All Cloudify Manager services must be running, as
26 #       indicated by the output of the cfy status command.
27 #    -- The plugins have been loaded.  This is indicated by the
28 #       presence of the /opt/manager/plugins-loaded file.
29
30 PLUGINS_LOADED=/opt/manager/plugins-loaded
31
32 set -x
33
34 if [[ -f  $PLUGINS_LOADED ]]
35 then
36   # Check for all services running
37   if /scripts/cloudify-ready.sh
38   then
39     exit 0
40   fi
41 fi
42 exit 1