#!/bin/bash

#function to provide help
#desc: this function provide help menu
#argument: -h for help, -p for path, -r for repository
#calling syntax: options

options() {
  cat <<EOF
Usage: $0 [PARAMs]
-h                  : help
-l (Location)           : path for searching values.yaml
                      [in case no path is provided then is will scan current directories for values.yml]
-r (Repository)     : name of image repository
                      [format [repository name/url]:(port)]
                      [in case no repository is provided then defualt image repository will be nexus3.onap.org:10001]
-u (User)           : user name for login
                      [in case no user name is provided then default user will be docker]
-p (Password)       : password for login
                      [in case no password is provided then default user will be docker]
EOF
}

#function to parse yaml file
#desc: this function convert yaml file to dotted notion
#argument: yaml file
#calling syntax: parse_yaml <yaml_file_name>

function parse_yaml {
   local prefix=$2
   local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
   sed -ne "s|^\($s\):|\1|" \
        -e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
        -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p"  $1 |
   awk -F$fs '{
      indent = length($1)/2;
      vname[indent] = $2;
      for (i in vname) {if (i > indent) {delete vname[i]}}
      if (length($3) > 0) {
         vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])(".")}
         printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, $2, $3);
      }
   }'
}

#algorithmic steps
#start
#scan all values.yaml files
#parse yaml file into dotted format
#for each lines check there is image tag in line
#store image name and check next line for version information
#if in next line version is not present as a subtag then call docker pull with imageName
#if version is present in next line then call docker pull with imageName and imageVersion
#end


#start processing for finding images and version
IMAGE_TEXT="image"
IMAGE_VERSION_TEXT="Version"
LOCATION="."
VALUES_FILE_NAME="values.yaml"
IMAGE_REPOSITORY="nexus3.onap.org:10001"
USER_NAME="docker"
PASSWORD="docker"

#scan for options menu
while getopts ":h:l:r:u:p:" PARAM; do
  case $PARAM in
    h)
      options
      exit 1
      ;;
    l)
      LOCATION=${OPTARG}
      ;;
    r)
      IMAGE_REPOSITORY=${OPTARG}
      ;;
    u)
      USER_NAME=${OPTARG}
      ;;
    p)
      PASSWORD=${OPTARG}
      ;;
    ?)
      options
      exit
      ;;
  esac
done


#docker login to nexus repo
echo docker login -u $USER_NAME -p $PASSWORD $IMAGE_REPOSITORY
docker login -u $USER_NAME -p $PASSWORD $IMAGE_REPOSITORY

#scan all values.yaml files recursively
for filename in `find $LOCATION -name $VALUES_FILE_NAME`
do
        imageNameWithVersion=" ";
        #parse yaml files
        for line in  `parse_yaml $filename`
        do
                #find all image subtag inside converted values.yaml file's lines
                if echo $line | grep -q $IMAGE_TEXT ; then
                        #find imageName inside line
                        imageName=`echo $line | awk -F "=" '{print $2}'`
                        #remove attional prefix and postfix
                        imageNameFinal=`echo "$imageName" | sed -e 's/^"//' -e 's/"$//' `

                        #check if line contain Version as a subtag in lines if yes then call docker pull with version
                        if echo $line | grep -q $IMAGE_VERSION_TEXT ; then
                                echo docker pull "$imageNameWithVersion":"$imageNameFinal"
                                docker pull $imageNameWithVersion:$imageNameFinal &
                                imageNameWithVersion=" "
                        else
                                #check Version is not in subtag and old scanned value is present then call docker pull without version
                                if [ "$imageNameWithVersion" != " " ]; then
                                        echo docker pull "$imageNameWithVersion"
                                        docker pull $imageNameWithVersion &
                                        imageNameWithVersion=$imageNameFinal
                                else
                                        imageNameWithVersion=$imageNameFinal
                                fi
                        fi


                fi


        done
done
# complete processing
echo "finished launching pulls"
#MAX_WAIT_INTERVALS=300
INTERVAL_COUNT=300
while [  $(ps -ef | grep docker | grep pull | grep -v $0 | wc -l) -gt 0 ]; do
  sleep 10
  INTERVAL_COUNT=$((INTERVAL_COUNT - 1))
  echo "waiting for last pull"
  if [ "$INTERVAL_COUNT" -eq 0 ]; then
    break
  fi
done

