2

I'm trying to run a build script in Gitlab CI but it complains about a syntax error that I don't understand.

This is the script I have configured in Gitlab:

# test syntax of all *.php and *.ctp files
for f in $(find . -name "*.php" -or -name "*.ctp")
do 
    php -l $f
done

and this is the output of Gitlab after commit:

cd /opt/gitlab-runner/embedded/service/gitlab-runner/tmp/builds/project-1 && git reset --hard && git clean -fdx && git remote set-url origin http://gitlab-ci-token:[email protected]/web/portals.git && git fetch origin
HEAD is now at da5f9b9 test CI 7
From http://git01.peoplefone.com/web/portals
   da5f9b9..559f74b  develop    -> origin/develop
cd /opt/gitlab-runner/embedded/service/gitlab-runner/tmp/builds/project-1 && git reset --hard && git checkout 559f74be65167b67cd7761cb8cbae8bcb528dd40
HEAD is now at da5f9b9 test CI 7
Previous HEAD position was da5f9b9... test CI 7
HEAD is now at 559f74b... test CI 8
# test syntax of all *.php and *.ctp files
for f in $(find . -name "*.php" -or -name "*.ctp")
/tmp/executor20150409-17218-twsoje: line 12: syntax error near unexpected token `echo'

as you can see I don't have any 'echo' statement in my script, could anyone help me on that? thanks a lot.

1 Answer 1

2

After trying a bit the following script worked:

# test syntax of all *.php and *.ctp files
for file in $(find . -name *.php -or -name *.ctp); do
    php -l $file;
done

but I still don't understand the error above..

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.