diff --git a/lib/gitlab/ci/templates/Terraform-Module.gitlab-ci.yml b/lib/gitlab/ci/templates/Terraform-Module.gitlab-ci.yml index 4beaaae9d934ae97c47cc7d73600ce48eb1c9743..d9135345e2ae9e73f23514582958f018976d85bd 100644 --- a/lib/gitlab/ci/templates/Terraform-Module.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Terraform-Module.gitlab-ci.yml @@ -8,14 +8,10 @@ include: - template: Jobs/SAST-IaC.gitlab-ci.yml # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/SAST-IaC.gitlab-ci.yml stages: - - validate - build - test - deploy -fmt: - extends: .terraform-module:fmt - # See the included job template at `Terraform/Module-Base.gitlab-ci.yml` to learn about supported variables. deploy: extends: .terraform-module:deploy diff --git a/lib/gitlab/ci/templates/Terraform/Module-Base.gitlab-ci.yml b/lib/gitlab/ci/templates/Terraform/Module-Base.gitlab-ci.yml index 6d5bd7c2172dfd9df3cda4cae66d30245dfb3588..77047739d105481aefa72cfb9f10c299406fcabc 100644 --- a/lib/gitlab/ci/templates/Terraform/Module-Base.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Terraform/Module-Base.gitlab-ci.yml @@ -16,15 +16,6 @@ variables: TERRAFORM_MODULE_SYSTEM: local # The system or provider your Terraform module targets (ex. local, aws, google). TERRAFORM_MODULE_VERSION: ${CI_COMMIT_TAG} # The version - it's recommended to follow SemVer for Terraform Module Versioning. -.terraform-module:fmt: - stage: validate - image: $CI_TEMPLATE_REGISTRY_HOST/gitlab-org/terraform-images/stable:latest - variables: - TF_ROOT: $TERRAFORM_MODULE_DIR - script: - - gitlab-terraform fmt - allow_failure: true - .terraform-module:deploy: stage: deploy image: $CI_TEMPLATE_REGISTRY_HOST/gitlab-org/terraform-images/stable:latest diff --git a/spec/lib/gitlab/ci/templates/terraform_module_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/terraform_module_gitlab_ci_yaml_spec.rb index 7c3c1776111b5de97becd0f7de0196d56814ecdb..01a75b8263373a9e769fa757e9dc269b07e3e32c 100644 --- a/spec/lib/gitlab/ci/templates/terraform_module_gitlab_ci_yaml_spec.rb +++ b/spec/lib/gitlab/ci/templates/terraform_module_gitlab_ci_yaml_spec.rb @@ -10,9 +10,9 @@ subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Terraform-Module') } shared_examples 'on any branch' do - it 'creates fmt and kics job', :aggregate_failures do + it 'creates kics job', :aggregate_failures do expect(pipeline.errors).to be_empty - expect(build_names).to include('fmt', 'kics-iac-sast') + expect(build_names).to include('kics-iac-sast') end it 'does not create a deploy job', :aggregate_failures do @@ -53,9 +53,9 @@ context 'when on tag' do let(:pipeline_ref) { '1.0.0' } - it 'creates fmt and deploy job', :aggregate_failures do + it 'creates deploy job', :aggregate_failures do expect(pipeline.errors).to be_empty - expect(build_names).to include('fmt', 'deploy') + expect(build_names).to include('deploy') end end end