diff options
author | Tony Hansen <tony@att.com> | 2017-10-06 21:01:05 +0000 |
---|---|---|
committer | Tony Hansen <tony@att.com> | 2017-10-06 21:01:13 +0000 |
commit | 1d01367aa505d2a2c6f6ad450c051ba7fb1e21af (patch) | |
tree | 9b9d5d64a85502f999e2e9b7898742e44a05b82c /mvn-phase-script.sh | |
parent | 749bc2d89911bcb91dcf3a3d84edcf2cb5a151c2 (diff) |
fix type file references
try to fix blueprints to where the files actually are in nexus
note: relationships types file is still missing
Change-Id: If7ee9a2b35828a4ce9f630141bc07290a1852280
Signed-off-by: Tony Hansen <tony@att.com>
Issue-ID: DCAEGEN2-128
Diffstat (limited to 'mvn-phase-script.sh')
-rwxr-xr-x | mvn-phase-script.sh | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/mvn-phase-script.sh b/mvn-phase-script.sh index 8c5c9a9..1aa2f9d 100755 --- a/mvn-phase-script.sh +++ b/mvn-phase-script.sh @@ -121,7 +121,7 @@ expand_templates() return 0 fi - echo "====> Resolving the following temaplate from environment variables " + echo "====> Expanding the following template from environment variables " echo "[$TEMPLATES]" SELFFILE=$(echo "$0" | rev | cut -f1 -d '/' | rev) for TEMPLATE in $TEMPLATES; do @@ -149,14 +149,34 @@ expand_templates() done #if [ ! -z "$FILES" ]; then - # echo "====> Resolving template $VALUE to value $VALUE" + # echo "====> Expanding template $VALUE to value $VALUE" # #CMD="grep -rl \"$VALUE\" | tr '\n' '\0' | xargs -0 sed -i \"s/{{[[:space:]]*$VALUE[[:space:]]*}}/$VALUE/g\"" # grep -rl "$KEY" | tr '\n' '\0' | xargs -0 sed -i 's/$KEY/$VALUE2/g' # #echo $CMD # #eval $CMD #fi done - echo "====> Done template reolving" + echo "====> Done template expanding" +} + +test_templates() +{ + # make certain that the type references exist + TMP=$(mktemp) + trap 'rm -f $TMP' 0 1 2 3 15 + find . -name '*-template' | sed -e 's/-template$//' | + while read file + do + egrep '^ - .?https?://' < $file + done | awk '{print $2}' | sed -e 's/"//g' | sort -u | + while read url + do + curl -L -w '%{http_code}' -s -o /dev/null "$url" > $TMP + case $(< $TMP) in + 2* ) ;; + * ) echo ">>>>>>>>>>>>>>>> $url not found <<<<<<<<<<<<<<<<" ;; + esac + done } @@ -357,6 +377,7 @@ compile) ;; test) echo "==> test phase script" + test_templates ;; package) echo "==> package phase script" |