I'm trying to create a makefile var that contains either an env var if it's set or a default value by:
get_tag:
$(eval TAG=$(shell [[ -z ${DOCKER_TAG} ]] && echo "latest" || echo ${DOCKER_TAG}))
echo ${TAG}
I think this should make TAG available to other stages and that it should use the DOCKER_TAG env var if it is set and use "latest" if it is not set.
However, when I run the makefile, it gives me this output
$ DOCKER_TAG=test make get_tag
/bin/sh: 1: [[: not found
echo test
test
$ make get_tag
/bin/sh: 1: [[: not found
echo
Why does it throw an error saying it can't find [[
?