Commit 8ad9776a authored by nimrod's avatar nimrod
Browse files

Use CI templates for Terraform jobs.

parent 8b42d2f9
Loading
Loading
Loading
Loading
Loading
+4 −17
Original line number Diff line number Diff line
@@ -2,9 +2,8 @@
include:
  - project: shore/ci-templates
    file: templates/pre-commit.yml

variables:
  TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/default
  - project: shore/ci-templates
    file: templates/terraform.yml

stages:
  - test
@@ -30,27 +29,15 @@ Generate payload:
      - .cache/

Terraform plan:
  extends: .tf_plan
  stage: plan
  image: &tf_image registry.gitlab.com/gitlab-org/terraform-images/stable:latest
  script:
    - gitlab-terraform plan
    - gitlab-terraform plan-json
  dependencies:
    - Generate payload
  artifacts:
    name: plan
    paths:
      - plan.cache
    reports:
      terraform: plan.json

Terraform apply:
  extends: .tf_apply
  stage: apply
  image: *tf_image
  script:
    - gitlab-terraform apply
  dependencies: &tf_apply_dependecies
    - Generate payload
    - Terraform plan
  when: manual
  needs: *tf_apply_dependecies