首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gitlab CI构建脚本语法错误

gitlab CI构建脚本语法错误
EN

Stack Overflow用户
提问于 2015-04-09 07:19:09
回答 1查看 1.3K关注 0票数 2

我试图在Gitlab CI中运行一个构建脚本,但是它抱怨一个语法错误,我不明白。

这是我在Gitlab中配置的脚本:

代码语言:javascript
复制
# test syntax of all *.php and *.ctp files
for f in $(find . -name "*.php" -or -name "*.ctp")
do 
    php -l $f
done

这是Gitlab提交后的输出:

代码语言:javascript
复制
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:xxxxxx@git01.peoplefone.com/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'

正如你所看到的,我的剧本里没有任何“回声”声明,有人能帮我吗?非常感谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-04-09 10:02:07

在尝试之后,下面的脚本成功了:

代码语言:javascript
复制
# test syntax of all *.php and *.ctp files
for file in $(find . -name *.php -or -name *.ctp); do
    php -l $file;
done

但我还是不明白上面的错误。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29532200

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档