A R Karthick | 1fa6654 | 2017-08-10 14:15:29 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Matteo Scandolo | 48d3d2d | 2017-08-08 13:05:27 -0700 | [diff] [blame] | 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 Karthick | 1ef0c00 | 2016-05-13 13:36:30 -0700 | [diff] [blame] | 17 | ##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 |
| 19 | tag=${1:-latest} |
| 20 | repo_digest="$HOME/onos_repo_digest.txt" |
| 21 | echo "Pulling ONOS $tag" |
| 22 | digest=`docker pull onosproject/onos:$tag | grep Digest` |
| 23 | echo "Got $digest for ONOS $tag" |
| 24 | repo=`echo $digest | cut -d ":" -f2- | sed 's,[[:space:]]*,,'` |
| 25 | echo "ONOS $tag repo id $repo saved in $repo_digest" |
| 26 | d=`date +%D` |
A R Karthick | 1fa6654 | 2017-08-10 14:15:29 -0700 | [diff] [blame] | 27 | echo "$d onosproject/onos:$tag $repo" >>$repo_digest |