diff options
author | Tomáš Levora <t.levora@partner.samsung.com> | 2019-07-09 15:33:48 +0200 |
---|---|---|
committer | Tomáš Levora <t.levora@partner.samsung.com> | 2019-09-20 18:02:56 +0200 |
commit | 70ec9f45965ae9ef3d65df19886412deba376524 (patch) | |
tree | cd54f6a6eaaf6d06a940207a6e33fc91f6ccf48e | |
parent | ef1aef15d17eae648f9eaf720c85d9c1f3f5e97e (diff) |
Add more info to generated blob data
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 <t.levora@partner.samsung.com>
-rwxr-xr-x | build/build_nexus_blob.sh | 8 |
1 files changed, 7 insertions, 1 deletions
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}) |