Gitlab artifacts creation fails when shell commands are used directly

Viewed 117

I'm facing a very weird issue in configuring CI with gitlab.

In my .gitlab-ci.yml file I have following definition

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

This Job fails with a very generic message

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

Now what I did is I put the mkdir and pylint commands in a bash script and executed that in script section like below :

 script:
    - sh bin/execute-pylint.sh

This works like a charm.

So my question is what is the difference between these two approaches ? If possible, Can somebody point me to some docs where such behavior is documented.

0 Answers
Related