Moving dev branch code to master branch
[yaml_builds.git] / tools / 3deploy_site.sh
index 7436496..5f30f0e 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
 ##############################################################################
-# Copyright © 2018 AT&T Intellectual Property. All rights reserved.          #
+# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.        #
 #                                                                            #
 # Licensed under the Apache License, Version 2.0 (the "License"); you may    #
 # not use this file except in compliance with the License.                   #
@@ -22,7 +22,7 @@ source $(dirname $0)/setenv.sh
 
 if [ -z "$1" ]
 then
-  echo "Plese pass site name as command line argument"
+  echo "Please pass site name as command line argument"
   exit -2
 else
   SITE=${SITE:-$1}
@@ -31,21 +31,14 @@ fi
 
 source $(dirname $0)/env_$SITE.sh
 
-KEYSTONE_IMAGE=$(grep "keystone_db_sync" $AIC_CLCP_MANIFESTS/global/v4.0/software/config/versions.yaml | uniq | awk '{print $2}')
-SHIPYARD_IMAGE=$(grep "shipyard_db_sync" $AIC_CLCP_MANIFESTS/global/v4.0/software/config/versions.yaml | uniq | awk '{print $2}')
-
-DRYDOCK_PASSWORD=$(grep "^data:" $AIC_CLCP_MANIFESTS/site/$SITE/secrets/passphrases/ucp_drydock_keystone_password.yaml | awk '{print $2}')
-SHIPYARD_PASSWORD=$(grep "^data:" $AIC_CLCP_MANIFESTS/site/$SITE/secrets/passphrases/ucp_shipyard_keystone_password.yaml | awk '{print $2}')
-REGION_NAME=$SITE
-
-mkdir -p $YAML_BUILDS/tools/$SITE
-cp $YAML_BUILDS/tools/deploy_site.sh $YAML_BUILDS/tools/$SITE/
-sed -i -e "s,KEYSTONE_IMAGE=,KEYSTONE_IMAGE=$KEYSTONE_IMAGE,g" $YAML_BUILDS/tools/$SITE/deploy_site.sh
-sed -i -e "s,SHIPYARD_IMAGE=,SHIPYARD_IMAGE=$SHIPYARD_IMAGE,g" $YAML_BUILDS/tools/$SITE/deploy_site.sh
-sed -i -e "s/DRYDOCK_PASSWORD=/DRYDOCK_PASSWORD=$DRYDOCK_PASSWORD/g" $YAML_BUILDS/tools/$SITE/deploy_site.sh
-sed -i -e "s/SHIPYARD_PASSWORD=/SHIPYARD_PASSWORD=$SHIPYARD_PASSWORD/g" $YAML_BUILDS/tools/$SITE/deploy_site.sh
-sed -i -e "s/REGION_NAME=/REGION_NAME=$REGION_NAME/g" $YAML_BUILDS/tools/$SITE/deploy_site.sh
-sed -i -e "s/{{yaml.genesis.host}}/$GENESIS_HOST/g" $YAML_BUILDS/tools/$SITE/deploy_site.sh
-
-scp $YAML_BUILDS/tools/$SITE/deploy_site.sh $GENESIS_HOST:/opt/sitename/aic-clcp-manifests/tools/
-ssh $GENESIS_HOST 'bash /opt/sitename/aic-clcp-manifests/tools/deploy_site.sh'
+ssh $GENESIS_HOST << EOF
+  cd /root/akraino
+  bash configs/promenade-bundle/genesis.sh
+  # Shipyard takes time to really come up and start responding.
+  date
+  sleep 900
+  # Following is a workaround, tested on dell servers.
+  # TODO to be removed when not required.
+  bash update_iptables.sh
+  bash deploy_site.sh
+EOF