Moving dev branch code to master branch
[yaml_builds.git] / tools / 3deploy_site.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.        #
4 #                                                                            #
5 # Licensed under the Apache License, Version 2.0 (the "License"); you may    #
6 # not use this file except in compliance with the License.                   #
7 #                                                                            #
8 # You may obtain a copy of the License at                                    #
9 #       http://www.apache.org/licenses/LICENSE-2.0                           #
10 #                                                                            #
11 # Unless required by applicable law or agreed to in writing, software        #
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT  #
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.           #
14 # See the License for the specific language governing permissions and        #
15 # limitations under the License.                                             #
16 ##############################################################################
17
18
19 set -x
20
21 source $(dirname $0)/setenv.sh
22
23 if [ -z "$1" ]
24 then
25   echo "Please pass site name as command line argument"
26   exit -2
27 else
28   SITE=${SITE:-$1}
29   echo "SITE=$SITE"
30 fi
31
32 source $(dirname $0)/env_$SITE.sh
33
34 ssh $GENESIS_HOST << EOF
35   cd /root/akraino
36   bash configs/promenade-bundle/genesis.sh
37   # Shipyard takes time to really come up and start responding.
38   date
39   sleep 900
40   # Following is a workaround, tested on dell servers.
41   # TODO to be removed when not required.
42   bash update_iptables.sh
43   bash deploy_site.sh
44 EOF