0

I have the following code in Makefile:

PROJECT=accounts/$(LZ)
VALUES=${PROJECT}/values/$(VALUES_FOLDER)
HELM=helm 
VALUES_ARGUMENT=''

lint:
if [ -z "${VALUES}" ]; then \
    for file in ${VALUES}/*; do \
        VALUES_ARGUMENT+=" $(basename "$file")"; \
    done \
    ${HELM} lint ${PROJECT} -f ${PROJECT}/values/${VALUES_ARGUMENT} ; \
else \
    echo "No Value Files Exist for ${LZ}" ; \
fi

I run this in my terminal with make lint LZ=contentmgmt VALUES_FOLDER=prod-vir but this consistently fails with :

    kaulk$ make lint LZ=contentmgmt VALUES_FOLDER=prod-vir
if [ -z "accounts/contentmgmt/values/prod-vir" ]; then \
        for file in accounts/contentmgmt/values/prod-vir/*; do \
            VALUES_ARGUMENT+=" "; \
        done \
        helm  lint accounts/contentmgmt -f accounts/contentmgmt/values/'' ; \
    else \
        echo "No Value Files Exist for accounts/contentmgmt" ; \
    fi
/bin/sh: -c: line 0: syntax error near unexpected token `helm'
/bin/sh: -c: line 0: `if [ -z "accounts/contentmgmt/values/prod-vir" ]; then    for file in accounts/contentmgmt/values/prod-vir/*; do      VALUES_ARGUMENT+=" "; done  helm  lint accounts/contentmgmt -f accounts/contentmgmt/values/'' ; else    echo "No Value Files Exist for accounts/contentmgmt" ; fi'
make: *** [lint] Error 2

I am closing my for block and if block so im not sure what exactly is the issue here ?

user1795516
  • 451
  • 1
  • 8
  • 18

0 Answers0