Skip to content
Snippets Groups Projects
Commit 1716ab1f authored by Matt Kasa's avatar Matt Kasa
Browse files

Merge branch 'ci-extends' into 'master'

chore: Convert YAML anchors to :extends

See merge request gitlab-org/terraform-images!33
parents c24f7e01 46b52b4d
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ variables: ...@@ -6,7 +6,7 @@ variables:
TF_ADDRESS: "$CI_API_V4_URL/projects/$CI_PROJECT_ID/terraform/state/$CI_PIPELINE_IID-$STATE_NAME" TF_ADDRESS: "$CI_API_V4_URL/projects/$CI_PROJECT_ID/terraform/state/$CI_PIPELINE_IID-$STATE_NAME"
TFPLANTOOL_VERSION: "v0.1.0" TFPLANTOOL_VERSION: "v0.1.0"
.versions: &versions .versions:
parallel: parallel:
matrix: matrix:
- TERRAFORM_BASE: "hashicorp/terraform:0.13.5" - TERRAFORM_BASE: "hashicorp/terraform:0.13.5"
...@@ -33,7 +33,7 @@ shell check: ...@@ -33,7 +33,7 @@ shell check:
script: script:
- shellcheck src/**/*.sh - shellcheck src/**/*.sh
.dind: &dind .dind:
services: services:
- docker:19.03.5-dind - docker:19.03.5-dind
image: docker:19.03.5 image: docker:19.03.5
...@@ -41,14 +41,15 @@ shell check: ...@@ -41,14 +41,15 @@ shell check:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY" - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
build: build:
<<: *dind extends:
<<: *versions - .dind
- .versions
stage: build stage: build
script: script:
- docker image build --tag "$BUILD_IMAGE_NAME" --build-arg BASE=$TERRAFORM_BASE --build-arg TFPLANTOOL=$TFPLANTOOL_VERSION . - docker image build --tag "$BUILD_IMAGE_NAME" --build-arg BASE=$TERRAFORM_BASE --build-arg TFPLANTOOL=$TFPLANTOOL_VERSION .
- docker image push "$BUILD_IMAGE_NAME" - docker image push "$BUILD_IMAGE_NAME"
.test: &test .test:
image: "$BUILD_IMAGE_NAME" image: "$BUILD_IMAGE_NAME"
before_script: before_script:
- terraform version - terraform version
...@@ -61,15 +62,17 @@ build: ...@@ -61,15 +62,17 @@ build:
- tests/.terraform/ - tests/.terraform/
test-init: test-init:
<<: *test extends:
<<: *versions - .test
- .versions
stage: test-init stage: test-init
script: script:
- gitlab-terraform init - gitlab-terraform init
test-plan: test-plan:
<<: *test extends:
<<: *versions - .test
- .versions
stage: test-plan stage: test-plan
script: script:
- gitlab-terraform plan - gitlab-terraform plan
...@@ -83,16 +86,18 @@ test-plan: ...@@ -83,16 +86,18 @@ test-plan:
- "tests/*-plan.cache" - "tests/*-plan.cache"
test-apply: test-apply:
<<: *test extends:
<<: *versions - .test
- .versions
stage: test-apply stage: test-apply
script: script:
- mv $TERRAFORM_VERSION-plan.cache plan.cache - mv $TERRAFORM_VERSION-plan.cache plan.cache
- gitlab-terraform apply - gitlab-terraform apply
release: release:
<<: *dind extends:
<<: *versions - .dind
- .versions
stage: release stage: release
script: script:
- docker image pull "$BUILD_IMAGE_NAME" - docker image pull "$BUILD_IMAGE_NAME"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment