summaryrefslogtreecommitdiffstats
path: root/version-manifest/src/main/scripts
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-05-07 11:00:41 -0700
committerGary Wu <gary.i.wu@huawei.com>2018-05-07 11:00:41 -0700
commit3fc3c722df91d56b03c4b34aaa0bfd4e0a50a8cc (patch)
tree36c2e1e584530112ae2e7f8ded230596ce4d2ddc /version-manifest/src/main/scripts
parenta557fe7f4f2f5d7aa1049feb10c2c12fcfdc7baf (diff)
Add missing docker images from OOM helm charts
Change-Id: Ide98947905ed0de445a7858edf9f277256cc0eea Issue-ID: INT-488 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'version-manifest/src/main/scripts')
-rwxr-xr-xversion-manifest/src/main/scripts/merge-oom-images.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/version-manifest/src/main/scripts/merge-oom-images.sh b/version-manifest/src/main/scripts/merge-oom-images.sh
new file mode 100755
index 000000000..09bc12fd2
--- /dev/null
+++ b/version-manifest/src/main/scripts/merge-oom-images.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+if [ "$#" -ne 2 ]; then
+ echo "$0 <docker-manifest.csv> <oom directory>"
+ exit 1
+fi
+
+# expected parameters
+MANIFEST=$1
+OOM_DIR=$2
+
+if [ -z "$WORKSPACE" ]; then
+ export WORKSPACE=`git rev-parse --show-toplevel`
+fi
+
+DIR=$(dirname $(readlink -f "$0"))
+TARGET_DIR=$DIR/target
+rm -rf $TARGET_DIR
+mkdir -p $TARGET_DIR
+cd $TARGET_DIR
+
+cd $OOM_DIR
+rgrep "image: .*" --include=values.yaml -h | cut -d ' ' -f 2 | tr -d '"'| grep -v '<' | grep -e "^onap" -e "^openecomp" | LC_ALL=C sort > $TARGET_DIR/oom-manifest.txt
+touch $TARGET_DIR/docker-manifest-new-entries.txt
+
+for line in $(cat $TARGET_DIR/oom-manifest.txt); do
+ image=$(echo $line | cut -d : -f 1)
+ tag=$(echo $line | cut -s -d : -f 2)
+ if [ -z "$tag" ]; then
+ tag="latest"
+ fi
+ if ! grep -q "$image" $MANIFEST; then
+ echo $image,$tag >> $TARGET_DIR/docker-manifest-new-entries.txt
+ fi
+done
+
+cat $MANIFEST $TARGET_DIR/docker-manifest-new-entries.txt | LC_ALL=C sort > $MANIFEST.tmp
+cp $MANIFEST.tmp $MANIFEST