From 70ec9f45965ae9ef3d65df19886412deba376524 Mon Sep 17 00:00:00 2001 From: Tomáš Levora Date: Tue, 9 Jul 2019 15:33:48 +0200 Subject: Add more info to generated blob data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed the way of storing nexus image information to nexus.ver in built blob Added information about OOM commit from which was the used onap docker images list generated Added information about oom/offline-installer commit used to build the nexus blob Example of the resulting nexus.ver in the nexus_data: nexus_image=sonatype/nexus3:3.15.2 nexus_image_digest=sha256:5d3600fd5cf27c3a789e7d4a3ce9448086d73a4247a118d8cdcdbabb1aff4ff7 used_image_list0=custom_docker_images.list used_image_list1=onap_docker_images.list used_image_list2=rke_docker_images.list oom_repo_commit=106dbc9a0224a3259f1eaf24d4bcc8571ed591ab installer_repo_commit=574255919970ffaf506c08d3eeaea8d6d7656236 Issue-ID: OOM-1969 Change-Id: Id824f97079fbd578cdc7af1ad959e95a52fe1d2c Signed-off-by: Tomáš Levora --- build/build_nexus_blob.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'build') diff --git a/build/build_nexus_blob.sh b/build/build_nexus_blob.sh index 51ab05e7..f964bf9d 100755 --- a/build/build_nexus_blob.sh +++ b/build/build_nexus_blob.sh @@ -333,7 +333,13 @@ chown 200:200 ${NEXUS_DATA_DIR} chmod 777 ${NEXUS_DATA_DIR} # Save Nexus version to prevent/catch data incompatibility -docker images --no-trunc | grep sonatype/nexus3 | awk '{ print $1":"$2" "$3}' > ${NEXUS_DATA_DIR}/nexus.ver +# Adding commit informations to have link to data from which the blob was built +cat >> ${NEXUS_DATA_DIR}/nexus.ver << INFO +nexus_image=$(docker image ls ${NEXUS_IMAGE} --no-trunc --format "{{.Repository}}:{{.Tag}}\nnexus_image_digest={{.ID}}") +$(for INDEX in ${!NXS_DOCKER_IMG_LISTS[@]}; do printf 'used_image_list%s=%s\n' "$INDEX" "$(sed 's/^.*\/\(.*\)$/\1/' <<< ${NXS_DOCKER_IMG_LISTS[$INDEX]})"; done) +$(sed -n 's/^.*OOM\ commit\ /oom_repo_commit=/p' ${NXS_DOCKER_IMG_LISTS[@]}) +installer_repo_commit=$(git --git-dir="${LOCAL_PATH}/../.git" rev-parse HEAD) +INFO # Start the Nexus NEXUS_CONT_ID=$(docker run -d --rm -v ${NEXUS_DATA_DIR}:/nexus-data:rw --name ${NEXUS_DOMAIN} ${PUBLISHED_PORTS} ${NEXUS_IMAGE}) -- cgit 1.2.3-korg