Commit cef09b0b authored by Krishna Nikhil Vedurumudi's avatar Krishna Nikhil Vedurumudi Committed by Daniel Scholl
Browse files

Added Lint Check in Pre-merge pipeline

parent 79489fb1
variables:
TF_VERSION: 0.14.4
GO_VERSION: 1.12.14
stages:
- validate
- build
- unit-test
image:
name: hashicorp/terraform:$TF_VERSION
entrypoint:
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
include:
- 'devops/premerge_pipeline/.tf-plan.yml'
- 'devops/premerge_pipeline/.unit-test.yml'
- 'devops/premerge_pipeline/.validate.yml'
- 'devops/gitlab/.tf-plan.yml'
- 'devops/gitlab/.go-lint.yml'
- 'devops/gitlab/.tf-lint.yml'
- 'devops/gitlab/.unit-test.yml'
tf-lint:
extends: .tf-lint
validate:
extends: .validate
go-lint:
extends: .go-lint
cr-unit-test:
extends: .unit-test
......
.go-lint:
stage: validate
image:
name: "golang:${GO_VERSION}"
entrypoint:
- "/usr/bin/env"
- "PATH=/go/bin:/usr/local/go/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
script:
- FILES_WITH_FMT_ISSUES=$(find . -name "*.go" | grep -v '.terraform' | xargs gofmt -l | wc -l)
- FILES_WITH_FMT_ISSUES=$(($FILES_WITH_FMT_ISSUES + 0))
- (if [[ $FILES_WITH_FMT_ISSUES == 0 ]]; then echo "✓ Go Lint Success!"; else find . -name "*.go" | grep -v '.terraform' | xargs gofmt -l; exit -1; fi);
.tf-lint:
stage: validate
script:
- terraform fmt -recursive -check
.validate:
stage: validate
script:
- echo "validate job"
......@@ -311,8 +311,8 @@ module "ad_application" {
name = local.ad_app_name
oauth2_allow_implicit_flow = true
group_membership_claims = "None"
group_membership_claims = "None"
reply_urls = [
"http://localhost:8080",
"http://localhost:8080/auth/callback"
......
Supports Markdown
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