X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=tools%2Fgenerate_yamls.sh;fp=tools%2Fgenerate_yamls.sh;h=45284423b58d776e66b7329dd2b7a74050074b8f;hb=8ca1343f22312d9711b92fed95ad52655842451a;hp=0000000000000000000000000000000000000000;hpb=674e68bc39ef4920273767fc5feb98a448fadab8;p=yaml_builds.git diff --git a/tools/generate_yamls.sh b/tools/generate_yamls.sh new file mode 100644 index 0000000..4528442 --- /dev/null +++ b/tools/generate_yamls.sh @@ -0,0 +1,46 @@ +#!/bin/bash +############################################################################## +# Copyright © 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. # +# # +# You may obtain a copy of the License at # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +############################################################################## + + +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" + exit -2 +else + SITE=${SITE:-$1} + echo "SITE=$SITE" +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