Martin Chacon Piza 844db67a91 Fix Docker build
The default nodeset was just changed to focal [1], which in the absence
of the python-is-python3 package doesn't provide a python binary.

[1] https://review.opendev.org/c/opendev/base-jobs/+/789098

Change-Id: I43e86ff631034bc6b35fedbc30b72282b5d3b7c8
2021-06-07 16:45:01 +02:00

20 lines
623 B
Bash
Executable File

#!/bin/bash
set -x # Print each script step.
set -eo pipefail # Exit the script if any statement returns error.
REAL_PATH=$(python3 -c "import os,sys;print(os.path.realpath('$0'))")
cd "$(dirname "$REAL_PATH")/../docker/"
BASE_GIT_COMMIT=$(git rev-parse --verify HEAD)
[ -z "${BASE_GIT_COMMIT}" ] && echo "No git commit hash found" && exit 1
BASE_CREATION_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
: "${MONASCA_COMMON_TAG:="master"}"
docker build --no-cache \
--build-arg BASE_CREATION_TIME="$BASE_CREATION_TIME" \
--build-arg BASE_GIT_COMMIT="$BASE_GIT_COMMIT" \
--tag monasca/base:"$MONASCA_COMMON_TAG" .