diff options
author | Marco Platania <platania@research.att.com> | 2019-05-15 18:43:49 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-05-15 18:43:49 +0000 |
commit | 56c1b328b0c982efa3bc42ba78656c062553be8e (patch) | |
tree | 36e7f7c3e1cdc9b6b72aba903fb5361f7de7dc31 | |
parent | 70d4edbf87d2c6fd3b07fac9f7bb5c8d862ecdc6 (diff) | |
parent | 9b3e607c7e20883b5192b79a28d7f4adaa47771b (diff) |
Merge "Script to get docker timestamps from ONAP instance"
-rwxr-xr-x | deployment/heat/onap-rke/scripts/get-image-tags.sh | 9 |
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 |