直接使用shell命令时,Gitlab工件创建失败

时间:2017-11-28 14:16:10

标签: bash shell gitlab

我在使用gitlab配置CI时遇到了一个非常奇怪的问题。

在我的.gitlab-ci.yml文件中,我有以下定义

pylint:
  before_script:
    - echo "Skipping before script"
  stage: prerequisites
  image: docker.artifactory.com/spark_build:1.7
  script:
    - mkdir ./pyspark/pylint
    - pylint ./fs/programs/pyspark/> ./pyspark/pylint/overall.txt
  artifacts:
    paths:
      - ./pyspark/pylint
    expire_in: 1 day
  tags:
   - kubernetes

此作业失败并显示非常通用的消息

ERROR: Job failed: error executing remote command: command terminated with non-zero exit code: Error executing in Docker Container: 1

现在我做的是将mkdirpylint命令放在bash脚本中并在脚本部分执行,如下所示:

 script:
    - sh bin/execute-pylint.sh

这就像一个魅力。

所以我的问题是这两种方法有什么区别?如果可能的话,有人可以指出一些记录了这种行为的文档。

0 个答案:

没有答案