include:
  - component: gitlab.com/$CI_PROJECT_PATH/full-pipeline@$CI_COMMIT_SHA
    inputs:
      _image_registry_base: $GITLAB_OPENTOFU_IMAGE_BASE
      version: $CI_COMMIT_SHA
      opentofu_version: $OPENTOFU_VERSION
      root_dir: $TEST_TF_ROOT
      state_name: $TEST_TF_STATE_NAME

stages: [validate, test, build, deploy, cleanup]

# Required to run everything immediately, instead of manually.

fmt:
  rules: [{when: always}]

validate:
  rules: [{when: always}]

plan:
  rules: [{when: always}]

apply: 
  rules: [{when: always}]

destroy:
  rules: [{when: always}]

delete-state:
  rules: [{when: always}]

