engine: Record component versions based on released stack
Change-Id: I5852760c5030f8a3693bec3117d44a7ea7366e8e
diff --git a/jjb/engine/scripts/generate-release-metadata.sh b/jjb/engine/scripts/generate-release-metadata.sh
index c429895..901fd8b 100755
--- a/jjb/engine/scripts/generate-release-metadata.sh
+++ b/jjb/engine/scripts/generate-release-metadata.sh
@@ -22,6 +22,30 @@
set -o errexit
set -o pipefail
+# NOTE (Fdegir): stacks use different tools so we need to record tool versions
+# depending on which stack we are releasing
+function record_component_versions() {
+ case "${STACK_TYPE}" in
+ ironic)
+ echo "NORDIX_BIFROST_VERSION=$NORDIX_BIFROST_VERSION" >> $RELEASE_METADATA_FILE
+ ;;
+ kubernetes)
+ echo "NORDIX_BIFROST_VERSION=$NORDIX_BIFROST_VERSION" >> $RELEASE_METADATA_FILE
+ echo "NORDIX_HEAT_VERSION=$NORDIX_HEAT_VERSION" >> $RELEASE_METADATA_FILE
+ echo "NORDIX_KUBESPRAY_VERSION=$NORDIX_KUBESPRAY_VERSION" >> $RELEASE_METADATA_FILE
+ ;;
+ onap)
+ echo "NORDIX_HEAT_VERSION=$NORDIX_HEAT_VERSION" >> $RELEASE_METADATA_FILE
+ echo "NORDIX_OOM_VERSION=$NORDIX_OOM_VERSION" >> $RELEASE_METADATA_FILE
+ ;;
+ openstack)
+ echo "NORDIX_BIFROST_VERSION=$NORDIX_BIFROST_VERSION" >> $RELEASE_METADATA_FILE
+ echo "NORDIX_KOLLA_VERSION=$NORDIX_KOLLA_VERSION" >> $RELEASE_METADATA_FILE
+ ;;
+ *) echo "ERROR : Invalid stack $STACK_TYPE"; exit 1;;
+ esac
+}
+
# file to record release metadata
export RELEASE_METADATA_FILE="$WORKSPACE/release.properties"
/bin/rm -f "$RELEASE_METADATA_FILE" /tmp/release.properties
@@ -48,16 +72,15 @@
STACK_TYPE=$STACK_TYPE
STACK_VERSION=$STACK_VERSION
PROMOTE_STACK=$PROMOTE_STACK
-NORDIX_ENGINE_VERSION=$NORDIX_ENGINE_VERSION
-NORDIX_KUBESPRAY_VERSION=$NORDIX_KUBESPRAY_VERSION
-NORDIX_BIFROST_VERSION=$NORDIX_BIFROST_VERSION
-NORDIX_HEAT_VERSION=$NORDIX_HEAT_VERSION
OFFLINE_INSTALLER_FILE=$OFFLINE_INSTALLER_FILE
BUILD_ARTIFACTS=$BUILD_ARTIFACTS
NORDIX_ARM_REPO=nordix-${STACK_TYPE}
NORDIX_ARTIFACT_URL=$NORDIX_ARTIFACT_URL
+NORDIX_ENGINE_VERSION=$NORDIX_ENGINE_VERSION
EOF
+record_component_versions
+
echo "Info : Release metadata"
echo "-------------------------------------------------------------------------"
cat "$RELEASE_METADATA_FILE"