2 ##############################################################################
4 # Copyright (c) 2019 AT&T Intellectual Property.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 ##############################################################################
20 # Installs well-known RIC charts then verifies specified helm chart
21 # Requires chart tgz archives in /tmp
24 while [ -n "$1" ]; do # while loop starts
33 -d) IMAGE_DIRECTORY_PATH=$2
38 *) echo "Option $1 not recognized. Please use -f to specify the recipe path." ;; # In case you typed a different option other than a,b,c
46 if [ -z "$IMAGELISTFILE" ]; then
47 echo "Image list file is missing. Please use -f to specify the path."
51 if [ -z "$IMAGE_DIRECTORY_PATH" ]; then
52 IMAGE_DIRECTORY_PATH=/tmp/ric_image
56 rm -rf $IMAGE_DIRECTORY_PATH
57 mkdir -p $IMAGE_DIRECTORY_PATH
60 while IFS= read -r image
62 if [[ $image == "#"* ]]; then
63 # supporting comment lines
67 IMAGENAME=$(echo $image | awk '{ n=split($0, a, "/"); print a[n] }')
69 echo "Pulling image $image"
70 RESULT=$(docker pull $image |& grep "no basic auth credentials" )
71 if [ ! -z "$RESULT" ]; then
72 echo "You are not logined to docker registry. Please login by running \"docker login DOCKER_REGISTRY\""
76 echo "Saving image $image"
77 docker save $image -o $IMAGE_DIRECTORY_PATH/$IMAGENAME
79 echo "************************************************************"
82 done < "$IMAGELISTFILE"
85 echo "RIC Images are downloaded to: $IMAGE_DIRECTORY_PATH"