+
+set_variables_common(){
+echo "---> INFO: Setting all common variables"
+LOGS_SERVER="${LOGS_SERVER:-None}"
+if [ "${LOGS_SERVER}" == 'None' ]; then
+ echo "FAILED: log server not found"
+ exit 1
+fi
+NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/"
+# Verify if using release file or parameters
+if $USE_RELEASE_FILE ; then
+ release_files=$(git diff-tree --no-commit-id -r "$GERRIT_PATCHSET_REVISION" --name-only -- "releases/" ".releases/")
+ if (( $(grep -c . <<<"$release_files") > 1 )); then
+ echo "---> INFO: RELEASE FILES ARE AS FOLLOWS: $release_files"
+ echo "---> ERROR: Committing multiple release files in the same commit OR rename/amend of existing files is not supported."
+ exit 1
+ else
+ release_file="$release_files"
+ echo "---> INFO: RELEASE FILE: $release_files"
+ fi
+else
+ echo "This job is built with parameters, no release file needed. Continuing..."
+ release_file="None"
+fi
+
+DISTRIBUTION_TYPE="${DISTRIBUTION_TYPE:-None}"
+if [[ $DISTRIBUTION_TYPE == "None" ]]; then
+ DISTRIBUTION_TYPE="$(niet ".distribution_type" "$release_file")"
+fi
+
+PATCH_DIR="$(mktemp -d)"
+
+# Displaying Release Information (Common variables)
+echo "RELEASE ENVIRONMENT INFO:"
+echo "RELEASE_FILE: $release_file"
+echo "LOGS_SERVER: $LOGS_SERVER"
+echo "NEXUS_PATH: $NEXUS_PATH"
+echo "JENKINS_HOSTNAME: $JENKINS_HOSTNAME"
+echo "SILO: $SILO"
+echo "PROJECT: $PROJECT"
+echo "PROJECT-DASHED: ${PROJECT//\//-}"
+echo "DISTRIBUTION_TYPE: $DISTRIBUTION_TYPE"
+}
+
+set_variables_maven(){
+VERSION="${VERSION:-None}"
+if [[ $VERSION == "None" ]]; then
+ VERSION="$(niet ".version" "$release_file")"
+fi
+LOG_DIR="${LOG_DIR:-None}"
+if [[ $LOG_DIR == "None" ]]; then
+ LOG_DIR="$(niet ".log_dir" "$release_file")"
+fi
+LOGS_URL="${LOGS_SERVER}/${NEXUS_PATH}${LOG_DIR}"
+LOGS_URL=${LOGS_URL%/} # strip any trailing '/'
+
+# Continuing displaying Release Information (Maven)
+echo "RELEASE MAVEN INFO:"
+echo "VERSION: $VERSION"
+echo "LOG DIR: $LOG_DIR"
+echo "LOGS URL: $LOGS_URL"
+}
+
+set_variables_container(){
+VERSION="${VERSION:-None}"
+if [[ $VERSION == "None" ]]; then
+ VERSION="$(niet ".container_release_tag" "$release_file")"
+fi
+
+ref="$(niet ".ref" "$release_file")"
+
+# Continuing displaying Release Information (Container)
+echo "RELEASE CONTAINER INFO:"
+echo "CONTAINER_RELEASE_TAG: $VERSION"
+echo "GERRIT_REF_TO_TAG: $ref"
+}
+