Add script to sync heat template from manifest 21/46921/1
authorGary Wu <gary.i.wu@huawei.com>
Wed, 9 May 2018 22:04:32 +0000 (15:04 -0700)
committerGary Wu <gary.i.wu@huawei.com>
Wed, 9 May 2018 22:04:32 +0000 (15:04 -0700)
Also clean up other helper scripts

Change-Id: Icae9cac8c6e9e3cef5e52e66bf79d6c30d23d235
Issue-ID: INT-495
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
version-manifest/src/main/scripts/add-images-from-oom.sh [moved from version-manifest/src/main/scripts/merge-oom-images.sh with 87% similarity]
version-manifest/src/main/scripts/check-sorted.sh
version-manifest/src/main/scripts/update-heat-image-versions.sh [new file with mode: 0755]
version-manifest/src/main/scripts/update-oom-image-versions.sh

@@ -1,8 +1,8 @@
 #!/bin/bash
 
 if [ "$#" -ne 2 ]; then
-    echo This script adds docker images that exist in OOM helm charts into docker-manifest.csv
-    echo "$0 <docker-manifest.csv> <oom directory>"
+    echo This script adds new docker images from OOM helm charts into docker-manifest.csv
+    echo "$0 <docker-manifest.csv> <oom repo directory>"
     exit 1
 fi
 
index fa120f3..70ca5ac 100755 (executable)
@@ -1,4 +1,11 @@
 #!/bin/bash
+
+if [ "$#" -ne 1 ]; then
+    echo This script checks the input file to verify that it is sorted
+    echo "$0 <manifest.csv>"
+    exit 1
+fi
+
 LC_ALL=C sort -c $1
 retval=$?
 if [ $retval -ne 0 ]; then
diff --git a/version-manifest/src/main/scripts/update-heat-image-versions.sh b/version-manifest/src/main/scripts/update-heat-image-versions.sh
new file mode 100755 (executable)
index 0000000..19415bb
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+if [ "$#" -ne 2 ]; then
+    echo This script updates HEAT docker versions to use versions in docker-manifest.csv
+    echo "$0 <docker-manifest.csv> <demo repo directory>"
+    exit 1
+fi
+
+# expected parameters
+MANIFEST=$(realpath $1)
+DEMO_DIR=$(realpath $2)
+
+if [ -z "$WORKSPACE" ]; then
+    export WORKSPACE=`git rev-parse --show-toplevel`
+fi
+
+cd $DEMO_DIR/heat/ONAP
+
+source <(./manifest-to-env.sh < $MANIFEST)
+envsubst < onap_openstack_template.env > onap_openstack.env
index eba8478..1a82b49 100755 (executable)
@@ -2,7 +2,7 @@
 
 if [ "$#" -ne 2 ]; then
     echo This script updates OOM helm charts to use versions in docker-manifest.csv
-    echo "$0 <docker-manifest.csv> <oom directory>"
+    echo "$0 <docker-manifest.csv> <oom repo directory>"
     exit 1
 fi
 
@@ -14,12 +14,6 @@ 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/kubernetes
 
 for line in $(tail -n +2 $MANIFEST); do