X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=tools%2Fgenerate_yamls.sh;h=f49ddd533138ac63c3fd18a075b3a0a248412bbe;hb=ae93d21c2f982d215d30c59710037426878e3439;hp=45284423b58d776e66b7329dd2b7a74050074b8f;hpb=8ca1343f22312d9711b92fed95ad52655842451a;p=yaml_builds.git diff --git a/tools/generate_yamls.sh b/tools/generate_yamls.sh old mode 100644 new mode 100755 index 4528442..f49ddd5 --- a/tools/generate_yamls.sh +++ b/tools/generate_yamls.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,24 +15,13 @@ # limitations under the License. # ############################################################################## +set -x source $(dirname $0)/setenv.sh -if [ -z "$AIC_CLCP_MANIFESTS" ] -then - echo "Please follow https://codecloud.web.att.com/projects/ST_CCP/repos/aic-clcp-manifests/browse/docs/source/deployment_blueprint.md to clone aic-clcp-manifests. Also export AIC_CLCP_MANIFESTS to it." - exit -1 -fi - -if [ -z "$AIC_CLCP_SECURITY_MANIFESTS" ] -then - echo "Please follow https://codecloud.web.att.com/projects/ST_CCP/repos/aic-clcp-manifests/browse/docs/source/deployment_blueprint.md to clone aic-clcp-security-manifests. Also export AIC_CLCP_SECURITY_MANIFESTS to it." - exit -1 -fi - 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} @@ -40,7 +29,26 @@ else fi cd $YAML_BUILDS -python ./scripts/jcopy.py $SITE.yaml ./templates/aic-clcp-manifests $AIC_CLCP_MANIFESTS/site/$SITE -python ./scripts/jcopy.py $SITE.yaml ./templates/aic-clcp-security-manifests $AIC_CLCP_SECURITY_MANIFESTS/site/$SITE -python ./scripts/jcopy.py $SITE.yaml ./templates/yaml_builds/set_site_env.sh ./tools/ -mv ./tools/set_site_env.sh ./tools/env_$SITE.sh + +# ECHO INPUT FILE TO LOGS FOR TROUBLESHOOTING +echo "#######################################" +echo "# USING INPUT FILE [${YAML_BUILDS}\${SITE}.yaml]" +echo "#######################################" +sed -E 's/(^.*password:).*/\1 ###PASSWORD REMOVED####/g' ${YAML_BUILDS}\${SITE}.yaml +echo "#######################################" + +python ./scripts/jcopy.py $SITE.yaml ./tools/j2/set_site_env.sh ./tools/env_$SITE.sh +source ./tools/env_$SITE.sh + +if [ ! -d "$AIRSHIP_TREASUREMAP" ]; then + echo "ERROR: Missing AIRSHIP_TREASUREMAP directory [$AIRSHIP_TREASUREMAP]." + exit -1 +fi + +if [ ! -d "$AIRSHIP_TEMPLATES" ]; then + echo "ERROR: Missing AIRSHIP_TEMPLATES directory [$AIRSHIP_TEMPLATES]." + exit -1 +fi + +python ./scripts/jcopy.py $SITE.yaml $AIRSHIP_TEMPLATES $YAML_BUILDS/site/$SITE +cp -r site/common/* site/$SITE/