Skip to content

Commit

Permalink
Merge pull request #8 from miguelhar/miguelhar/test-tfmod
Browse files Browse the repository at this point in the history
Miguelhar/test tfmod
  • Loading branch information
miguelhar authored Jan 3, 2023
2 parents ba23e9f + 1d41686 commit 3f7d0ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
15 changes: 3 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,13 @@ jobs:
- terraform/install:
terraform_version: '1.3.6'
- run:
name: "Get previous release"
name: "Provision using previous release"
working_directory: tests
command: |
previous_tag="$(git describe --tags --abbrev=0 --first-parent ${CIRCLE_TAG}^)"
echo "Checking out previous tag: $previous_tag"
git checkout "tags/${previous_tag}"
- run:
name: "Provision using previous release"
working_directory: tests
command: |
export TF_VAR_tag="$(git describe --tags --abbrev=0 --first-parent ${CIRCLE_TAG}^)"
export TF_VAR_tag="${previous_tag}"
terraform init
terraform validate
terraform apply --auto-approve
Expand All @@ -50,17 +47,11 @@ jobs:
command: |
echo "Checking out current tag: ${CIRCLE_TAG}"
git checkout "tags/${CIRCLE_TAG}"
- run:
name: "Provision using current release"
working_directory: tests
command: |
export TF_VAR_tag="${CIRCLE_TAG}"
terraform init --reconfigure --upgrade
terraform validate
terraform apply --auto-approve
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# .tfstate files
*.tfstate
*.tfstate.*

.terraform.lock.hcl
# Crash log files
crash.log

Expand Down
4 changes: 2 additions & 2 deletions tests/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variable "tag" {
default = "tag A"
default = "v0.0.0"
}

output "tag" {
value = var.test
value = var.tag
}

0 comments on commit 3f7d0ef

Please sign in to comment.