Disable globally defined services and before_script for a specific job

Hi all,

In gitlab-ci.yml, for a particular job how to disable the globally defined services and before_script? All my other jobs are using the docker:dind service, but I need one to only execute a shell script.

I’m digging up this question, but the answer could help someone.
To do this you need to overide each globally defined value for your specific job.

For exemple :

default:
  image: docker:stable
  services:
    - docker:dind

get-dependencies:
  image: node:8-alpine
  services: []

Also, globally defined is deprecated now, you should use default parameters, like in my exemple above.

Hate to dig this up again, but would the same apply for the gobal before_script?

Yes.
Just set it as an empty array

before_script: []

this might work also:

before_script:
  - ''