From b020c074618c0cdc9f70cd08fbd41a4f97b8986f Mon Sep 17 00:00:00 2001 From: Sujay Samanta Date: Mon, 9 Sep 2024 20:54:42 +0530 Subject: [PATCH] Add tf-migrate Formula to homebrew-tap (#288) * added tf-migrate formula for tap * Add tf-migrate to README product list --------- Co-authored-by: Brian Shore --- Formula/tf-migrate.rb | 44 +++++++++++++++++++++++++++ README.md | 1 + util/formula_templater/config.hcl | 14 +++++++++ util/lambda_trigger/lambda_trigger.go | 1 + 4 files changed, 60 insertions(+) create mode 100644 Formula/tf-migrate.rb diff --git a/Formula/tf-migrate.rb b/Formula/tf-migrate.rb new file mode 100644 index 0000000..2dc16c1 --- /dev/null +++ b/Formula/tf-migrate.rb @@ -0,0 +1,44 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +class TfMigrate < Formula + desc "TfMigrate" + homepage "https://www.terraform.io" + version "1.19.1" + + if OS.mac? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/tf-migrate/0.0.1-alpha/tf-migrate_0.0.1-alpha_darwin_amd64.zip" + sha256 "6ac35f82fd1ddebd21d7c1422fcf98f516965fab8c7b3d8770e7f0b5da157408" + end + + if OS.mac? && Hardware::CPU.arm? + url "https://releases.hashicorp.com/tf-migrate/0.0.1-alpha/tf-migrate_0.0.1-alpha_darwin_arm64.zip" + sha256 "e5faccbd20d7e82b86e06f87fd74dfbfd4077a233f16fd59b2bdc6a1239eecd9" + end + + if OS.linux? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/tf-migrate/0.0.1-alpha/tf-migrate_0.0.1-alpha_linux_amd64.zip" + sha256 "1431098d9d5299ce60652fa40b13b349cfa2a92b25f1de6c410f18c346296818" + end + + if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/tf-migrate/0.0.1-alpha/tf-migrate_0.0.1-alpha_linux_arm.zip" + sha256 "fc8b1235c44bf67b34dea908d4ed8cbd9b48262c5ff579ed3f6dc0d8b1662298" + end + + if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/tf-migrate/0.0.1-alpha/tf-migrate_0.0.1-alpha_linux_arm64.zip" + sha256 "24f0fa2258faf3a4d2adbec88636f8ef7c6556c079c56499e38097610898c83e" + end + + conflicts_with "tf-migrate" + + def install + bin.install "tf-migrate" + end + + test do + system "#{bin}/tf-migrate --version" + end + end + \ No newline at end of file diff --git a/README.md b/README.md index 2bd8bdf..7c558a1 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ brew install hashicorp/tap/packer brew install hashicorp/tap/sentinel brew install hashicorp/tap/terraform brew install hashicorp/tap/terraform-ls +brew install hashicorp/tap/tf-migrate brew install hashicorp/tap/tfstacks brew install hashicorp/tap/vault brew install hashicorp/tap/vault-enterprise diff --git a/util/formula_templater/config.hcl b/util/formula_templater/config.hcl index ff05a0a..c3a3619 100644 --- a/util/formula_templater/config.hcl +++ b/util/formula_templater/config.hcl @@ -441,3 +441,17 @@ formula { linux_arm64 = true } } + +formula { + product = "tf-migrate" + name = "tf-migrate" + desc = "tf-migrate" + homepage = "https://www.terraform.io" + architectures { + darwin_amd64 = true + darwin_arm64 = true + linux_amd64 = true + linux_arm = true + linux_arm64 = true + } +} diff --git a/util/lambda_trigger/lambda_trigger.go b/util/lambda_trigger/lambda_trigger.go index dad7e73..25b3564 100644 --- a/util/lambda_trigger/lambda_trigger.go +++ b/util/lambda_trigger/lambda_trigger.go @@ -65,6 +65,7 @@ func isProductSupported(product string) bool { "vagrant", "vlt", "vault-radar", + "tf-migrate", } for _, p := range supportedProducts {