Skip to content

Commit

Permalink
LIB-74: Replace tfenv and tgswitch with mise (#1405)
Browse files Browse the repository at this point in the history
  • Loading branch information
arsci committed May 6, 2024
1 parent df790da commit 64a1856
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ env: &env
GRUNTWORK_INSTALLER_VERSION: v0.0.36
MODULE_CI_VERSION: v0.46.0
MODULE_GCP_CI_VERSION: v0.1.1
MODULE_CI_CIRCLECI_HELPER_VERSION: v0.56.0
TERRAFORM_VERSION: 1.5.7
PACKER_VERSION: 1.7.4
TERRAGRUNT_VERSION: v0.52.0
Expand All @@ -14,6 +15,10 @@ env: &env
HELM_VERSION: v3.13.1
KUBECONFIG: /home/circleci/.kube/config
BIN_BUILD_PARALLELISM: 3
MISE_VERSION: v2024.4.0
# Mise ASDF defaults to using main.tf to determine the terraform version to use, so we need to
# override this to use the .terraform-version file instead.
ASDF_HASHICORP_TERRAFORM_VERSION_FILE: .terraform-version

defaults: &defaults
machine:
Expand All @@ -40,10 +45,11 @@ install_gruntwork_utils: &install_gruntwork_utils
name: install gruntwork utils
command: |
curl -Ls https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/master/bootstrap-gruntwork-installer.sh | bash /dev/stdin --version "${GRUNTWORK_INSTALLER_VERSION}"
gruntwork-install --module-name "gruntwork-module-circleci-helpers" --repo "https://github.com/gruntwork-io/terraform-aws-ci" --tag "${MODULE_CI_VERSION}"
gruntwork-install --module-name "gruntwork-module-circleci-helpers" --repo "https://github.com/gruntwork-io/terraform-aws-ci" --tag "${MODULE_CI_CIRCLECI_HELPER_VERSION}"
gruntwork-install --module-name "kubernetes-circleci-helpers" --repo "https://github.com/gruntwork-io/terraform-aws-ci" --tag "${MODULE_CI_VERSION}"
gruntwork-install --module-name "gcp-helpers" --repo "https://github.com/gruntwork-io/terraform-google-ci" --tag "${MODULE_GCP_CI_VERSION}"
configure-environment-for-gruntwork-module \
--mise-version ${MISE_VERSION} \
--terraform-version ${TERRAFORM_VERSION} \
--terragrunt-version ${TERRAGRUNT_VERSION} \
--packer-version ${PACKER_VERSION} \
Expand Down
4 changes: 2 additions & 2 deletions modules/files/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func IsExistingDir(path string) bool {
// This is useful when running multiple tests in parallel against the same set of Terraform files to ensure the
// tests don't overwrite each other's .terraform working directory and terraform.tfstate files. This method returns
// the path to the dest folder with the copied contents. Hidden files and folders (with the exception of the `.terraform-version` files used
// by the [tfenv tool](https://github.com/tfutils/tfenv) and `.terraform.lock.hcl` used by Terraform to lock providers versions), Terraform state
// by the [mise tool](https://github.com/jdx/mise) and `.terraform.lock.hcl` used by Terraform to lock providers versions), Terraform state
// files, and terraform.tfvars files are not copied to this temp folder, as you typically don't want them interfering with your tests.
// This method is useful when running through a build tool so the files are copied to a destination that is cleaned on each run of the pipeline.
func CopyTerraformFolderToDest(folderPath string, destRootFolder string, tempFolderPrefix string) (string, error) {
Expand Down Expand Up @@ -205,7 +205,7 @@ func PathContainsHiddenFileOrFolder(path string) bool {
return false
}

// PathIsTerraformVersionFile returns true if the given path is the special '.terraform-version' file used by the [tfenv](https://github.com/tfutils/tfenv) tool.
// PathIsTerraformVersionFile returns true if the given path is the special '.terraform-version' file used by the [mise](https://github.com/jdx/mise) tool.
func PathIsTerraformVersionFile(path string) bool {
return filepath.Base(path) == ".terraform-version"
}
Expand Down

0 comments on commit 64a1856

Please sign in to comment.