X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=tools%2F2genesis.sh;h=0da6f9206614deb064572f281f63ce2233967740;hb=fbb206730195c6f03ded7658d08f1ef708ebf88b;hp=40e3f9710012950862974c069cd17875aab76055;hpb=8ca1343f22312d9711b92fed95ad52655842451a;p=yaml_builds.git diff --git a/tools/2genesis.sh b/tools/2genesis.sh old mode 100644 new mode 100755 index 40e3f97..0da6f92 --- a/tools/2genesis.sh +++ b/tools/2genesis.sh @@ -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. # @@ -15,29 +15,52 @@ # limitations under the License. # ############################################################################## +set -xe +LOGDIR="/var/log/akraino" +mkdir -p $LOGDIR +LOGFILE="$LOGDIR/${1}_$(date +"%Y%m%d%H%M%z")_$(basename $0|cut -d. -f1)" +echo "logging to $LOGFILE" +exec 1> >(tee -a $LOGFILE) +exec 2>&1 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} echo "SITE=$SITE" fi +if [ -z "$YAML_BUILDS" ] +then + echo "Please set YAML_BUILDS" + exit -3 +fi + source $(dirname $0)/env_$SITE.sh -scp $AIC_CLCP_MANIFESTS/tools/promenade-bundle.tar $GENESIS_HOST:/tmp/ +cd $YAML_BUILDS +# Install OS on Genesis +python $YAML_BUILDS/scripts/jcopy.py $SITE.yaml $YAML_BUILDS/tools/j2/serverrc.j2 $YAML_BUILDS/tools/"$GENESIS_NAME"rc +/opt/akraino/redfish/install_server_os.sh --rc /opt/akraino/yaml_builds/tools/"$GENESIS_NAME"rc --skip-confirm + +scp $YAML_BUILDS/tars/promenade-bundle-$SITE.tar $GENESIS_HOST:/tmp/ ssh $GENESIS_HOST << EOF - mkdir -p /opt/sitename/aic-clcp-manifests/tools - cp /tmp/promenade-bundle.tar /opt/sitename/aic-clcp-manifests/tools/ - cd /opt/sitename/aic-clcp-manifests/tools/ - tar -xmf promenade-bundle.tar - mkdir configs/promenade - cp configs/promenade-bundle/*.yaml configs/promenade/ - bash /opt/sitename/aic-clcp-manifests/tools/configs/promenade-bundle/genesis.sh + # TODO avoid following hard coding$ + route add -net 192.168.41.0/24 gw 192.168.2.1 bond0.41 + mkdir -p /root/akraino + cp /tmp/promenade-bundle-$SITE.tar /root/akraino/ + cd /root/akraino/ + tar -xmf promenade-bundle-$SITE.tar EOF +# Update BIOS Setting +#python $YAML_BUILDS/scripts/update_bios_settings.py $SITE.yaml + +exec 2>&- +exec 1>&- +exit 0