Gary Wu | d285191 | 2019-05-09 08:50:23 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | realpath() { |
| 4 | OURPWD="$PWD" |
| 5 | cd "$(dirname "$1")" |
| 6 | LINK=$(readlink "$(basename "$1")") |
| 7 | while [ "$LINK" ]; do |
| 8 | cd "$(dirname "$LINK")" |
| 9 | LINK=$(readlink "$(basename "$1")") |
| 10 | done |
| 11 | REALPATH="$PWD/$(basename "$1")" |
| 12 | cd "$OURPWD" |
| 13 | echo "$REALPATH" |
| 14 | } |
| 15 | |
| 16 | if [ "$#" -ne 2 ]; then |
| 17 | echo This script creates a docker manifest using OOM helm charts as source |
| 18 | echo "$0 <docker-manifest.csv> <oom repo directory>" |
| 19 | exit 1 |
| 20 | fi |
| 21 | |
| 22 | # expected parameters |
| 23 | MANIFEST=$(realpath $1) |
| 24 | OOM_DIR=$(realpath $2) |
| 25 | |
| 26 | if [ -z "$WORKSPACE" ]; then |
| 27 | export WORKSPACE=`git rev-parse --show-toplevel` |
| 28 | fi |
| 29 | |
| 30 | cd $OOM_DIR/kubernetes |
| 31 | |
| 32 | echo "image,tag" > $MANIFEST.tmp |
Gary Wu | 8f3bfd7 | 2019-05-14 11:30:00 -0700 | [diff] [blame] | 33 | rgrep -h -E ':\s*onap/.*:.*' | awk '{$1=$1};1' | cut -d' ' -f2 | tr ':' ',' >> $MANIFEST.tmp |
Gary Wu | d285191 | 2019-05-09 08:50:23 -0700 | [diff] [blame] | 34 | LC_ALL=C sort -u < $MANIFEST.tmp > $MANIFEST |
| 35 | rm $MANIFEST.tmp |