2

My code for the pipeline is:

include:
 - template: Terraform/Base.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Terraform/Base.latest.gitlab-ci.yml
stages:
 - init
 - validate
 - build
 - deploy
init:
 extends: .init
validate:
 extends: .validate
build:
 extends: .build
deploy:
 extends: .deploy
 dependencies:
   - build

The error message I'm getting is:

Found errors in your .gitlab-ci.yml:  
init: unknown keys in extends (.init)  
You can also test your .gitlab-ci.yml in CI Lint
Ortomala Lokni
  • 56,620
  • 24
  • 188
  • 240
Dionys Seidel
  • 39
  • 2
  • 5
  • 1
    What is your .init section? – Pankaj May 14 '22 at 13:17
  • I'm guessing it comes from the template Terraform/Base.gitlab-ci.ym in the 'include' section. The reference is https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Terraform/Base.latest.gitlab-ci.yml Although I don't see any .init section in that file What would you suggest? – Dionys Seidel May 14 '22 at 15:40
  • 1
    Did you manage to resolve this in the end? – ThomasVdBerge May 31 '22 at 18:10

1 Answers1

-1

Is the code you shared for your .gitlab-ci.yml only a snippet? Where do you define your .init, .validate, .build, and .deploy job templates?

The pipeline template Terraform/Base.gitlab-ci.yml that you inherit from only has the following jobs defined that you can extend:

  • .terraform:fmt
  • .terraform:validate
  • .terraform:build
  • .terraform:deploy
  • .terraform:destroy

You can make use of https://gitlab.com/<group>/<project>/-/ci/lint to validate the syntax of your .gitlab-ci.yml file.

lyzlisa
  • 439
  • 4
  • 6