X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=tools%2F2genesis.sh;h=744294530afa246e9bfafaa7de8b2e1d3d3c4448;hb=98efca144dbc3dac0022543bdc0812a37bdb8a8c;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..7442945 --- 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,46 @@ # limitations under the License. # ############################################################################## +set -x +TIMESTAMP=$(date +"%Y%m%d%H%M") +echo "Logging to /var/log/yaml_builds/2genesis_$TIMESTAMP.log" +mkdir -p /var/log/yaml_builds +exec > /var/log/yaml_builds/2genesis_$TIMESTAMP.log +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