I am trying to set the variable of a Makefile variable if that variable is not set before and a file exists. However, I am having issues overwriting that variable. Any ideas?
GITHUB_TOKEN = ""
build:
if [ -z "$(GITHUB_TOKEN)" ] && [ -f ~/.config/github.token ]; then echo "Overriding github"; $(eval GITHUB_TOKEN="$(cat ~/.config/github.token)") fi
DOCKER_REGISTRY="$(DOCKER_REGISTRY)" DOCKER_TAG="$(RELEASE_TAG)" \
docker-compose -p $(PRO_NAME) \
-f docker/base.compose \
-f docker/build.compose \
build \
--build-arg GITHUB_TOKEN="$(GITHUB_TOKEN)"
--parallel --force-rm
In this case, I will keep --build-arg GITHUB_TOKEN=""""