Skip to content

Commit

Permalink
Merge pull request #9 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 4, 2023
2 parents 3f7d0ef + db5a5aa commit a3824d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ jobs:
name: "Provision using previous release"
working_directory: tests
command: |
previous_tag="$(git describe --tags --abbrev=0 --first-parent ${CIRCLE_TAG}^)"
previous_tag="$(git tag --list 'v*' | grep -B 1 ${CIRCLE_TAG} | head -1)"
echo "Checking out previous tag: $previous_tag"
git checkout "tags/${previous_tag}"
export TF_VAR_tag="${previous_tag}"
terraform init
terraform validate
terraform apply --auto-approve
- run:
name: "Get current release"
name: "Provision using current release"
working_directory: tests
command: |
echo "Checking out current tag: ${CIRCLE_TAG}"
git checkout "tags/${CIRCLE_TAG}"
Expand Down
7 changes: 7 additions & 0 deletions tests/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
variable "tag" {
default = "v0.0.0"
}
variable "release" {
default = "release 1"
}

output "tag" {
value = var.tag
}

output "release" {
value = var.release
}

0 comments on commit a3824d0

Please sign in to comment.