Commit a36e00c1 authored by Willian Paixao's avatar Willian Paixao

Update Terraform.latest.gitlab-ci.yml template

Changelog: changed
parent a9dbb0ab
...@@ -7,20 +7,17 @@ include: ...@@ -7,20 +7,17 @@ include:
- template: Terraform/Base.latest.gitlab-ci.yml # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Terraform/Base.latest.gitlab-ci.yml - template: Terraform/Base.latest.gitlab-ci.yml # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Terraform/Base.latest.gitlab-ci.yml
stages: stages:
- init
- validate - validate
- build - build
- deploy - deploy
- cleanup
init:
extends: .terraform:init
fmt: fmt:
extends: .terraform:fmt extends: .terraform:fmt
needs: []
validate: validate:
extends: .terraform:validate extends: .terraform:validate
needs: []
build: build:
extends: .terraform:build extends: .terraform:build
......
...@@ -21,18 +21,11 @@ cache: ...@@ -21,18 +21,11 @@ cache:
paths: paths:
- ${TF_ROOT}/.terraform/ - ${TF_ROOT}/.terraform/
.terraform:init: &terraform_init
stage: init
script:
- cd ${TF_ROOT}
- gitlab-terraform init
.terraform:fmt: &terraform_fmt .terraform:fmt: &terraform_fmt
stage: validate stage: validate
needs: []
script: script:
- cd ${TF_ROOT} - cd ${TF_ROOT}
- gitlab-terraform fmt -check -recursive - gitlab-terraform fmt
allow_failure: true allow_failure: true
.terraform:validate: &terraform_validate .terraform:validate: &terraform_validate
......
...@@ -27,7 +27,7 @@ RSpec.describe 'Terraform.latest.gitlab-ci.yml' do ...@@ -27,7 +27,7 @@ RSpec.describe 'Terraform.latest.gitlab-ci.yml' do
context 'on master branch' do context 'on master branch' do
it 'creates init, validate and build jobs', :aggregate_failures do it 'creates init, validate and build jobs', :aggregate_failures do
expect(pipeline.errors).to be_empty expect(pipeline.errors).to be_empty
expect(build_names).to include('init', 'validate', 'build', 'deploy') expect(build_names).to include('validate', 'build', 'deploy')
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment