blob: c08ecf28d5bfdebac2a93d28fc7f9a30d9bbae48 [file] [log] [blame]
Gary Wud2851912019-05-09 08:50:23 -07001#!/bin/bash
2
3realpath() {
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
16if [ "$#" -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
20fi
21
22# expected parameters
23MANIFEST=$(realpath $1)
24OOM_DIR=$(realpath $2)
25
26if [ -z "$WORKSPACE" ]; then
27 export WORKSPACE=`git rev-parse --show-toplevel`
28fi
29
30cd $OOM_DIR/kubernetes
31
32echo "image,tag" > $MANIFEST.tmp
Gary Wu8f3bfd72019-05-14 11:30:00 -070033rgrep -h -E ':\s*onap/.*:.*' | awk '{$1=$1};1' | cut -d' ' -f2 | tr ':' ',' >> $MANIFEST.tmp
Gary Wud2851912019-05-09 08:50:23 -070034LC_ALL=C sort -u < $MANIFEST.tmp > $MANIFEST
35rm $MANIFEST.tmp