build: allow overriding variables from a dot env file
This helps forks build custom rook releases more easily by allowing certain Makefile vars to be overwriten using a `.env` file. In addition this introduces the `DOCKERCMD` var to the `build/release/Makefile`. Signed-off-by: Alexander Trost <galexrt@googlemail.com> Signed-off-by: Deepika Upadhyay <deepika@koor.tech> Signed-off-by: Zuhair AlSader <zuhair@koor.tech>
This commit is contained in:
1 parent
87e836424e
commit
ecb6ba7383
5 files changed
+34
-26
No files matched your search
@@ -31,6 +31,21 @@ function promote() {
|
||||
# MAIN #
|
||||
#############
|
||||
|
||||
# Load dot env file if available
|
||||
if [ -f .env ]; then
|
||||
# shellcheck disable=SC2046
|
||||
export $(grep -v '^#' .env | xargs -d '\n')
|
||||
fi
|
||||
|
||||
# Use Git access token for accessing the docs repo if set
|
||||
# shellcheck disable=SC2034
|
||||
DOCS_GIT_REPO="${DOCS_GIT_REPO:-git@github.com:rook/rook.github.io.git}"
|
||||
if [ -n "${GIT_API_TOKEN}" ]; then
|
||||
DOCS_GIT_REPO="${DOCS_GIT_REPO//git@/}"
|
||||
DOCS_GIT_REPO="${DOCS_GIT_REPO//:/\/}"
|
||||
DOCS_GIT_REPO="https://${GIT_API_TOKEN}@${DOCS_GIT_REPO}"
|
||||
fi
|
||||
|
||||
SHOULD_PROMOTE=true
|
||||
if [[ ${GITHUB_REF} =~ master ]]; then
|
||||
echo "Publishing from master"
|
||||
|
||||
Reference in new issue
Block a user