Issue-ID: DOC-686 39/115039/1
authorThomas Kulik <thomas.kulik@telekom.de>
Wed, 18 Nov 2020 14:07:29 +0000 (15:07 +0100)
committerThomas Kulik <thomas.kulik@telekom.de>
Wed, 18 Nov 2020 14:09:53 +0000 (15:09 +0100)
fixed a problem for handling url for doc repo

Signed-off-by: Thomas Kulik <thomas.kulik@telekom.de>
Change-Id: I577267958b2cb2690c4a4b2a0c59912e6f0b4b07

tools/checkdocs.sh
tools/checkrtd.sh

index f58e1f5..1f7f10b 100755 (executable)
@@ -58,7 +58,7 @@
 ### SHORT: curl -s 'https://gerrit.onap.org/r/projects/?d' | awk '{if(NR>1)print}' | jq -c '.[] | {id, state}' | sed -r 's:%2F:/:g; s:["{}]::g; s:id\:::; s:,state\::|:; /All-Projects/d; /All-Users/d'
 ###
 
-script_version="1.1 (2020-11-17)"
+script_version="1.2 (2020-11-18)"
 
 # save command for the restart with logging enabled
 command=$0
@@ -71,9 +71,11 @@ fullcommand="${command} ${arguments}"
 
 # print usage
 function usage() {
+  echo "                                                           "
+  echo " checkdocs.sh Version ${script_version}"
   echo "                                                           "
   echo " USAGE:                                                    "
-  echo "  ./checkdocs.sh                                           "
+  echo "  ./checkdocs.sh <arguments>                               "
   echo "                                                           "
   echo " ARGUMENTS:                                                "
   echo "  -u|--user username                                       "
index 8be384c..e626dd9 100755 (executable)
@@ -27,6 +27,7 @@ for line in "${array[@]}"
 do
 
   reponame=$(echo ${line} | cut -d "[" -f2 | cut -d "]" -f1)
+  #reponame="[${reponame}]"
   #echo "DBUG: reponame=${reponame}"
 
   # example line: [dmaap/messagerouter/messageservice]/docs/release-notes/release-notes.rst
@@ -41,7 +42,12 @@ do
   # warning: path does not always contain "docs"!
   # line:   [dmaap/messagerouter/messageservice]/docs/release-notes/release-notes.rst
   # output:                                           release-notes/release-notes.html
-  url_file=$(echo ${line} | sed -r 's/^.+\]//' | sed -r 's/^.*docs\///' | sed -r 's/\.rst$/\.html/' )
+  url_file=$(echo ${line} | sed -r 's/^.+\]//' | sed -r 's/^.*\/docs\///' | sed -r 's/\.rst$/\.html/' )
+
+  #echo "DBUG:     line = ${line}"
+  #echo "DBUG: url_file = ${url_file}"
+  #echo "DBUG: url_repo = ${url_repo}"
+  #echo "DBUG: reponame = ${reponame}"
 
   # build the full url
   if [[ ${reponame} == "doc" ]]; then
@@ -53,7 +59,8 @@ do
     url_start="https://docs.onap.org/projects/onap"
     url="${url_start}-${url_repo}/${url_lang}/${url_branch}/${url_file}"
   fi
-  #echo "DBUG: url=$url"
+
+  #echo "DBUG:      url = $url"
 
   # check with curl if html page is accessible (no content check!)
   # to prevent (server side) cached results a unique element is added to the request