aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/heat/onap-rke/scripts
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2019-05-15 10:59:08 -0700
committerGary Wu <gary.i.wu@huawei.com>2019-05-15 10:59:08 -0700
commit9b3e607c7e20883b5192b79a28d7f4adaa47771b (patch)
treee610e27e43331c75e0a618610158a807a97964fc /deployment/heat/onap-rke/scripts
parent8f3bfd740a868f4d2ccfc965880053f6712152b3 (diff)
Script to get docker timestamps from ONAP instance
Change-Id: I8270244ab16280517a22df3898990be547dbc49b Issue-ID: INT-1055 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'deployment/heat/onap-rke/scripts')
-rwxr-xr-xdeployment/heat/onap-rke/scripts/get-image-tags.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/deployment/heat/onap-rke/scripts/get-image-tags.sh b/deployment/heat/onap-rke/scripts/get-image-tags.sh
new file mode 100755
index 000000000..7c7508448
--- /dev/null
+++ b/deployment/heat/onap-rke/scripts/get-image-tags.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+CHECKSUMS=$(kubectl get pods -o jsonpath="{..imageID}" |tr -s '[[:space:]]' '\n' | grep '/onap' | sed 's|.*/onap|onap|' | sort -u)
+
+for checksum in $CHECKSUMS; do
+ sha256=$(echo $checksum | sed 's/.*@sha256://g')
+ tag=$(curl -s https://nexus3.onap.org/service/rest/v1/search?assets.attributes.checksum.sha256=$sha256 | jq -r '.items[] | (.name + ":" + .version + "_")' | grep -v latest | sort -V | tail -1 | sed 's/_$//')
+ echo ${tag:-${checksum}}
+done