#!/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>

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
                #skiping commented line
                if [ "${line:0:1}" != '#' ]; then
                        #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
                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

