blob: ebd463b326d30ce40376e976899c2a9363188b0d [file] [log] [blame]
A R Karthick1fa66542017-08-10 14:15:29 -07001#!/usr/bin/env bash
Matteo Scandolo48d3d2d2017-08-08 13:05:27 -07002# 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##Use this script as SUDO to pull ONOS safely as it saves/archives repo digest ids.
18##Repo digest ids are saved in $HOME/onos_repo_digest.txt
19tag=${1:-latest}
20repo_digest="$HOME/onos_repo_digest.txt"
21echo "Pulling ONOS $tag"
22digest=`docker pull onosproject/onos:$tag | grep Digest`
23echo "Got $digest for ONOS $tag"
24repo=`echo $digest | cut -d ":" -f2- | sed 's,[[:space:]]*,,'`
25echo "ONOS $tag repo id $repo saved in $repo_digest"
26d=`date +%D`
A R Karthick1fa66542017-08-10 14:15:29 -070027echo "$d onosproject/onos:$tag $repo" >>$repo_digest