I am implementing Auto Build in my Gitlab project. For that I am using gitlab-ci.yml file with multi-line YAML blocks containing shell commands, the code is as follows:
if [ "${GITLAB_USER_LOGIN}" != "nadirabbas" ]
then
echo "Building"
if [ ! -d "dist" ]; then mkdir dist; fi
if [ ! -f "dist/index.html" ]; then touch dist/index.html; fi
fi
I have tried many solutions such as putting a ; after the if statement, also after the fi keyword, but nothing seems to work, My job log returns the following syntax error:
syntax error near unexpected token `fi'
I have tried to google it, but other solutions don't seem to work. The shell my runner is using is bash.