set -e

echo ======== PROMOTE HASH

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/dlrnapi_venv.sh

trap deactivate_dlrnapi_venv EXIT
activate_dlrnapi_venv

source $WORKSPACE/hash_info.sh

if [ "$RELEASE" = "master" ]; then
    COMMIT_HASH=3b718f3fecc866332ec0663fa77e758f8346ab93
    DISTRO_HASH=4204ba89997cae739e41526b575027e333a2277d
fi

set -u

# Assign label to the specific hash using the DLRN API
dlrnapi --url $DLRNAPI_URL \
    --username review_rdoproject_org \
    repo-promote \
    --commit-hash $COMMIT_HASH \
    --distro-hash $DISTRO_HASH \
    --promote-name $PROMOTE_NAME

echo ======== PROMOTE HASH COMPLETED

set -e

echo ======== PROMOTE HASH

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/dlrnapi_venv.sh

trap deactivate_dlrnapi_venv EXIT
activate_dlrnapi_venv

source $WORKSPACE/hash_info.sh

set -u

# Assign label to the specific hash using the DLRN API
dlrnapi --url $DLRNAPI_URL \
    --username review_rdoproject_org \
    repo-promote \
    --commit-hash $COMMIT_HASH \
    --distro-hash $DISTRO_HASH \
    --promote-name $PROMOTE_NAME

echo ======== PROMOTE HASH COMPLETED

Revert "tripleo: fix the pin"
Revert "tripleo: fix the pin"

This reverts commit 40516a810d7ad210dba84e863cbe595d47fe3b44.

Revert "temporarily pin master to a fixed hash"

This reverts commit beb889ff6ad79d83180dd63b41f0026217c1d412.

Change-Id: Ia78d546867f911816f2d200bc7c04e65eac70696
