Change repository links usage in Dockerfile and build image

Used to be: git.openstack.org/openstack/monasca-persister?h=stable/pike
Now : releases.openstack.org/constraints/upper/pike

Since the way links to specific branches changed, usage of
those links has to be changed as well.
CONSTRAINTS_BRANCH variable was removed because CONSTRAINTS_FILE
contains link to the upper-requirements file with specified branch.

Change-Id: Ic67b2b30906768fa6249d10ed2c7e8037df0f544
Story: 2005666
Task: 30971
This commit is contained in:
Dobroslaw Zybort 2019-09-25 15:20:21 +02:00 committed by Witek Bedyk
parent 0b5ea44874
commit a91f77617e
2 changed files with 5 additions and 6 deletions

View File

@ -1,5 +1,5 @@
ARG DOCKER_IMAGE=monasca/log-api
ARG APP_REPO=https://opendev.org/openstack/monasca-log-api
ARG APP_REPO=https://review.opendev.org/openstack/monasca-log-api
# Branch, tag or git hash to build from.
ARG REPO_VERSION=master

View File

@ -59,7 +59,7 @@ cd "$(dirname "$REAL_PATH")/../docker/"
REPO_VERSION_CLEAN=$(echo "$REPO_VERSION" | sed 's|/|-|g')
[ -z "$APP_REPO" ] && APP_REPO=$(\grep APP_REPO Dockerfile | cut -f2 -d"=")
GITHUB_REPO=$(echo "$APP_REPO" | sed 's/opendev.org/github.com/' | \
GITHUB_REPO=$(echo "$APP_REPO" | sed 's/review.opendev.org/github.com/' | \
sed 's/ssh:/https:/')
if [ -z "$CONSTRAINTS_FILE" ]; then
@ -75,10 +75,11 @@ fi
case "$REPO_VERSION" in
*stable*)
CONSTRAINTS_BRANCH_CLEAN="$REPO_VERSION"
CONSTRAINTS_FILE=${CONSTRAINTS_FILE/master/$CONSTRAINTS_BRANCH_CLEAN}
# Get monasca-common version from stable upper constraints file.
CONSTRAINTS_TMP_FILE=$(mktemp)
wget --output-document "$CONSTRAINTS_TMP_FILE" \
"$CONSTRAINTS_FILE"?h="$CONSTRAINTS_BRANCH_CLEAN"
$CONSTRAINTS_FILE
UPPER_COMMON=$(\grep 'monasca-common' "$CONSTRAINTS_TMP_FILE")
# Get only version part from monasca-common.
UPPER_COMMON_VERSION="${UPPER_COMMON##*===}"
@ -92,9 +93,8 @@ esac
# Monasca-common variables.
if [ -z "$COMMON_REPO" ]; then
COMMON_REPO=$(\grep COMMON_REPO Dockerfile | cut -f2 -d"=") || true
: "${COMMON_REPO:=https://opendev.org/openstack/monasca-common}"
: "${COMMON_REPO:=https://review.opendev.org/openstack/monasca-common}"
fi
: "${COMMON_VERSION:=$3}"
if [ -z "$COMMON_VERSION" ]; then
COMMON_VERSION=$(\grep COMMON_VERSION Dockerfile | cut -f2 -d"=") || true
@ -144,7 +144,6 @@ docker build --no-cache \
--build-arg REPO_VERSION="$REPO_VERSION" \
--build-arg GIT_COMMIT="$GIT_COMMIT" \
--build-arg CONSTRAINTS_FILE="$CONSTRAINTS_FILE" \
--build-arg CONSTRAINTS_BRANCH="$CONSTRAINTS_BRANCH_CLEAN" \
--build-arg COMMON_REPO="$COMMON_REPO" \
--build-arg COMMON_VERSION="$COMMON_VERSION" \
--build-arg COMMON_GIT_COMMIT="$COMMON_GIT_COMMIT" \