A R Karthick | 1ef0c00 | 2016-05-13 13:36:30 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | ##Use this script as SUDO to pull ONOS safely as it saves/archives repo digest ids. |
| 3 | ##Repo digest ids are saved in $HOME/onos_repo_digest.txt |
| 4 | tag=${1:-latest} |
| 5 | repo_digest="$HOME/onos_repo_digest.txt" |
| 6 | echo "Pulling ONOS $tag" |
| 7 | digest=`docker pull onosproject/onos:$tag | grep Digest` |
| 8 | echo "Got $digest for ONOS $tag" |
| 9 | repo=`echo $digest | cut -d ":" -f2- | sed 's,[[:space:]]*,,'` |
| 10 | echo "ONOS $tag repo id $repo saved in $repo_digest" |
| 11 | d=`date +%D` |
| 12 | echo "$d onosproject/onos:$tag $repo" >>$repo_digest |