Alexander Herold
Alexander Herold

Reputation: 1147

How to override global before_script with empty before_script in job

Is it possible to override the global before_script with an empty before_script within a job?

Upvotes: 67

Views: 35628

Answers (2)

Jakub Kania
Jakub Kania

Reputation: 16477

You should use an empty array notation.

before_script:
- global before script

job:
  before_script: []
  script:
  - test

Upvotes: 82

rpadovani
rpadovani

Reputation: 7360

Yes, the local before_script overrides the global before_script. To keep the .yml sintax valid, use a command that does nothing.

before_script:
- global before script

job:
  before_script:
  - ''

Upvotes: 91

Related Questions