[ad_1]
I don’t get why the below layer doesn’t work:
RUN if [ "$PROMOTE" = 1 ] && [ "${MY_ENV}" = "PRODUCTION" ]; then curl -S -w "%{http_code}" -X GET "${API_URL}" |bash ; fi
It calls the ULR inside ${API_URL} variable, but bash abots the build with the desired response from my api alongside with a “command not found” message.
bash: line 1: message:Your API has been called with status Approved200: command not found
My guessing is the the problem lies on how I evaluate the above condition. Somehow bash does not accept it. This doesn’t happens if I avaluate a single condition like e.g
RUN if [ "$PROMOTE" = 1 ]; then curl -S -w "%{http_code}" -X GET "${API_URL}" |bash ; fi
[ad_2]