r/gitlab•
Lydrin

Gitlab CI default parameters question

Hi everyone,

I have a question about the default parameters in a Gitlab CI pipeline.

In the documentation it's said that in order to have a default parameter you need to write it this way :

default:
    image: ruby:2.5

rspec:
    script: bundle exec rspec

rspec 2.6:
    image: ruby:2.6
    script: bundle exec rspec

But, I see a lot of pipeline without this default keyword, for example this one for a Spring Boot application :

image: java:8

stages:
    - build
before_script:
    - chmod +x mvnw

build:
    stage: build
    script: ./mvnw package
    artifacts:
    paths:
        - target/demo-0.0.1-SNAPSHOT.jar

In the example above, java:8 is also a default parameter for all the jobs (and you can overwrite it in a specific job)

My question is : What is the point of the default keyword, if you have the same behaviour without it ?

Thank you !

Posted Oct 9, 2019, 10:20 AM UTC

10

No comments yet

Nobody commented on this post, or the comments weren't captured.