blob: c60b37c763994926ce75a9ce9a2450d518cc18af [file] [log] [blame]
A R Karthick1ef0c002016-05-13 13:36:30 -07001#!/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
4tag=${1:-latest}
5repo_digest="$HOME/onos_repo_digest.txt"
6echo "Pulling ONOS $tag"
7digest=`docker pull onosproject/onos:$tag | grep Digest`
8echo "Got $digest for ONOS $tag"
9repo=`echo $digest | cut -d ":" -f2- | sed 's,[[:space:]]*,,'`
10echo "ONOS $tag repo id $repo saved in $repo_digest"
11d=`date +%D`
12echo "$d onosproject/onos:$tag $repo" >>$repo_digest