blob: 73791e41537e7731a5c8d9c87ff8a9c1c63308e6 [file] [log] [blame]
Matteo Scandolo48d3d2d2017-08-08 13:05:27 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
A R Karthick1ef0c002016-05-13 13:36:30 -070017#!/usr/bin/env bash
18##Use this script as SUDO to pull ONOS safely as it saves/archives repo digest ids.
19##Repo digest ids are saved in $HOME/onos_repo_digest.txt
20tag=${1:-latest}
21repo_digest="$HOME/onos_repo_digest.txt"
22echo "Pulling ONOS $tag"
23digest=`docker pull onosproject/onos:$tag | grep Digest`
24echo "Got $digest for ONOS $tag"
25repo=`echo $digest | cut -d ":" -f2- | sed 's,[[:space:]]*,,'`
26echo "ONOS $tag repo id $repo saved in $repo_digest"
27d=`date +%D`
28echo "$d onosproject/onos:$tag $repo" >>$repo_digest