【问题标题】:gitlab CI build script syntax errorgitlab CI 构建脚本语法错误
【发布时间】:2015-04-09 18:02:07
【问题描述】:

我正在尝试在 Gitlab CI 中运行构建脚本,但它抱怨我不理解的语法错误。

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

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

这是提交后 Gitlab 的输出:

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'

如您所见,我的脚本中没有任何“回声”语句,有人可以帮助我吗?非常感谢。

【问题讨论】:

    标签: build-script gitlab-ci


    【解决方案1】:

    在尝试了一下之后,下面的脚本工作了:

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

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

    【讨论】:

      猜你喜欢
      • 2015-10-07
      • 2022-01-15
      • 2021-10-23
      • 2023-04-10
      • 2018-07-25
      • 1970-01-01
      • 2016-02-25
      • 1970-01-01
      • 2021-10-14
      相关资源
      最近更新 更多