Sobes.tech
Junior — Middle

How is a dot denoted in the .gitlab-ci.yml file?

sobes.tech AI

Answer from AI

In the .gitlab-ci.yml file, the dot (.) is used to denote the current context or to include other configurations.

For example, when using the extends directive, the dot can refer to a local element within the same file:

.job_template:
  script:
    - echo "Hello"

job1:
  extends: .job_template

Here, .job_template is a hidden (private) template, whose name starts with a dot.

The dot can also be used in paths when including external files:

include:
  - local: './ci-templates/build.yml'

Thus, the dot in .gitlab-ci.yml most often indicates the current directory or serves as part of the name of a hidden template.