From d285191b63896f5e4d6c98f8cc6ba6b720891757 Mon Sep 17 00:00:00 2001 From: Gary Wu Date: Thu, 9 May 2019 08:50:23 -0700 Subject: Add script to create docker manifest from oom repo Change-Id: I09652f812b9c83dd510f75de58e3402572becf79 Issue-ID: INT-1055 Signed-off-by: Gary Wu --- .../src/main/scripts/compare-docker-manifests.sh | 4 +-- .../src/main/scripts/generate-docker-manifest.sh | 35 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100755 version-manifest/src/main/scripts/generate-docker-manifest.sh (limited to 'version-manifest') diff --git a/version-manifest/src/main/scripts/compare-docker-manifests.sh b/version-manifest/src/main/scripts/compare-docker-manifests.sh index 86f8221e9..73591326b 100755 --- a/version-manifest/src/main/scripts/compare-docker-manifests.sh +++ b/version-manifest/src/main/scripts/compare-docker-manifests.sh @@ -18,8 +18,8 @@ for line in $(join -t, $1 $2 | tail -n +2); do release=$(echo $line | cut -d , -f 2) staging=$(echo $line | cut -d , -f 3) - if [[ "${staging}_" < "${release}_" ]]; then - echo "[WARNING] $image:$staging is older than $release." + if [[ "${staging//./-}_" < "${release//./-}_" ]]; then + echo "[ERROR] $image:$staging is out-of-date vs. release ($release)." fi done exit $err diff --git a/version-manifest/src/main/scripts/generate-docker-manifest.sh b/version-manifest/src/main/scripts/generate-docker-manifest.sh new file mode 100755 index 000000000..18a0dbb09 --- /dev/null +++ b/version-manifest/src/main/scripts/generate-docker-manifest.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +realpath() { + OURPWD="$PWD" + cd "$(dirname "$1")" + LINK=$(readlink "$(basename "$1")") + while [ "$LINK" ]; do + cd "$(dirname "$LINK")" + LINK=$(readlink "$(basename "$1")") + done + REALPATH="$PWD/$(basename "$1")" + cd "$OURPWD" + echo "$REALPATH" +} + +if [ "$#" -ne 2 ]; then + echo This script creates a docker manifest using OOM helm charts as source + echo "$0 " + exit 1 +fi + +# expected parameters +MANIFEST=$(realpath $1) +OOM_DIR=$(realpath $2) + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=`git rev-parse --show-toplevel` +fi + +cd $OOM_DIR/kubernetes + +echo "image,tag" > $MANIFEST.tmp +rgrep -h -E ': onap/.*:.*' | awk '{$1=$1};1' | cut -d' ' -f2 | tr ':' ',' >> $MANIFEST.tmp +LC_ALL=C sort -u < $MANIFEST.tmp > $MANIFEST +rm $MANIFEST.tmp -- cgit 1.2.3-korg