Skip to content

Commit 8f03d41

Browse files
committed
feat: allow dynamic configuration of artifact host
The change replaces static references to `releases.hashicorp.com` with a configurable environment variable that defaults to `releases.hashicorp.com`. This allows a user to do the following `HOMEBREW_HASHICORP_ARTIFACT_REPOSITORY_HOST="https://my.hashicorp.releases.mirror" brew install terraform` and the zip would be retrieved from the host of the user's configuration instead of `releases.hashicorp.com` For those developing in environments with limited or restricted access to the public internet (i.e. behind corporate firewalls), external artifacts like the ones hosted on `releases.hashicorp.com` may often be made available on private systems via mirrors or proxies or rehosted entirely. In these scenarios where direct access to the canonical releases repository is unavailable, to use homebrew successfully with these "hashicorp mirrors", it is a requirement to deploy a MODIFIED fork of this tap repo, swapping the static references to `releases.hashicorp.com` for references to the mirror / proxy / private artifact host. The need for these modifications from the public tap is what I'm trying to eliminate by making these formula more configurable. With this configuration option available, this tap can be pulled into private environments UNMODIFIED, presumably eliminating the need for modifications or any effort to make them. The copywrite formula is a bit of an outlier in this repo. It has a unique artifact host (github releases), and it has a "This file was generated by GoReleaser. DO NOT EDIT." comment at the top. I chose to heed that instruction and left it alone. Willing to hear feedback if there's desire to add another environment variable there.
1 parent e16ad7f commit 8f03d41

28 files changed

+180
-124
lines changed

Casks/hashicorp-boundary-desktop.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Copyright (c) HashiCorp, Inc.
22
# SPDX-License-Identifier: MPL-2.0
33

4+
release_repository = +ENV["HOMEBREW_HASHICORP_ARTIFACT_REPOSITORY_HOST"] || "https://releases.hashicorp.com"
5+
46
cask "hashicorp-boundary-desktop" do
57
version "1.7.0"
68
sha256 "896613118290c5f7fea4760af84653077e670bb780fd036af78897b5edd5f42f"
79

8-
url "https://releases.hashicorp.com/boundary-desktop/#{version}/boundary-desktop_#{version}_darwin_amd64.dmg",
10+
url release_repository << "/boundary-desktop/#{version}/boundary-desktop_#{version}_darwin_amd64.dmg",
911
verified: "hashicorp.com/boundary-desktop/"
1012
name "Boundary Desktop"
1113
desc ""

Casks/hashicorp-vagrant.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Copyright (c) HashiCorp, Inc.
22
# SPDX-License-Identifier: MPL-2.0
33

4+
release_repository = +ENV["HOMEBREW_HASHICORP_ARTIFACT_REPOSITORY_HOST"] || "https://releases.hashicorp.com"
5+
46
cask "hashicorp-vagrant" do
57
version "2.4.0"
68
arch arm: "arm64", intel: "amd64"
79
sha256 arm: "97806047dfc7e0c3818f946a1c954ab03d8f6d1ae45d1aa43e5bdbd7a8856631",
810
intel: "97806047dfc7e0c3818f946a1c954ab03d8f6d1ae45d1aa43e5bdbd7a8856631"
9-
url "https://releases.hashicorp.com/vagrant/#{version}/vagrant_#{version}_darwin_#{arch}.dmg",
11+
url release_repository << "/vagrant/#{version}/vagrant_#{version}_darwin_#{arch}.dmg",
1012
verified: "hashicorp.com/vagrant/"
1113
name "Vagrant"
1214
desc "Development environment"

Formula/boundary-enterprise.rb

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,34 @@
22
# SPDX-License-Identifier: MPL-2.0
33

44
class BoundaryEnterprise < Formula
5+
release_repository = +ENV["HOMEBREW_HASHICORP_ARTIFACT_REPOSITORY_HOST"] || "https://releases.hashicorp.com"
6+
57
desc "Boundary Enterprise"
68
homepage "https://www.boundaryproject.io/"
79
version "0.14.1+ent"
810

911
if OS.mac? && Hardware::CPU.intel?
10-
url "https://releases.hashicorp.com/boundary/0.14.1+ent/boundary_0.14.1+ent_darwin_amd64.zip"
12+
url release_repository << "/boundary/0.14.1+ent/boundary_0.14.1+ent_darwin_amd64.zip"
1113
sha256 "c63033a77dee1d550f9174bb1d57ef79b569f3862a5d0b8e5a10dd870b991ea7"
1214
end
1315

1416
if OS.mac? && Hardware::CPU.arm?
15-
url "https://releases.hashicorp.com/boundary/0.14.1+ent/boundary_0.14.1+ent_darwin_arm64.zip"
17+
url release_repository << "/boundary/0.14.1+ent/boundary_0.14.1+ent_darwin_arm64.zip"
1618
sha256 "50723afa75f462c8f594504b7c223ed7ecb99b091ab6b6e523aa19614752dfe9"
1719
end
1820

1921
if OS.linux? && Hardware::CPU.intel?
20-
url "https://releases.hashicorp.com/boundary/0.14.1+ent/boundary_0.14.1+ent_linux_amd64.zip"
22+
url release_repository << "/boundary/0.14.1+ent/boundary_0.14.1+ent_linux_amd64.zip"
2123
sha256 "5add5627e03309eb873866bb2e7344b13939d65c4bdb61c6f6a9edd625c4fb22"
2224
end
2325

2426
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
25-
url "https://releases.hashicorp.com/boundary/0.14.1+ent/boundary_0.14.1+ent_linux_arm.zip"
27+
url release_repository << "/boundary/0.14.1+ent/boundary_0.14.1+ent_linux_arm.zip"
2628
sha256 "0dc4004d9397164aa7d78a10a7e63a7b2118ef48af64de4d3a1f86b365661eb9"
2729
end
2830

2931
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
30-
url "https://releases.hashicorp.com/boundary/0.14.1+ent/boundary_0.14.1+ent_linux_arm64.zip"
32+
url release_repository << "/boundary/0.14.1+ent/boundary_0.14.1+ent_linux_arm64.zip"
3133
sha256 "32358aa7c37bd220ab47fc1a16b9e850dcea09def96eeb3c4c213e03f3cbf644"
3234
end
3335

Formula/boundary.rb

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,34 @@
22
# SPDX-License-Identifier: MPL-2.0
33

44
class Boundary < Formula
5+
release_repository = +ENV["HOMEBREW_HASHICORP_ARTIFACT_REPOSITORY_HOST"] || "https://releases.hashicorp.com"
6+
57
desc "Boundary"
68
homepage "https://www.boundaryproject.io/"
79
version "0.14.1"
810

911
if OS.mac? && Hardware::CPU.intel?
10-
url "https://releases.hashicorp.com/boundary/0.14.1/boundary_0.14.1_darwin_amd64.zip"
12+
url release_repository << "/boundary/0.14.1/boundary_0.14.1_darwin_amd64.zip"
1113
sha256 "2ab4701fa927d7d59b1f2e4412bb962e4fda00367b9bae9f4732c2593e5f5ff8"
1214
end
1315

1416
if OS.mac? && Hardware::CPU.arm?
15-
url "https://releases.hashicorp.com/boundary/0.14.1/boundary_0.14.1_darwin_arm64.zip"
17+
url release_repository << "/boundary/0.14.1/boundary_0.14.1_darwin_arm64.zip"
1618
sha256 "e5f9902a0ea72cc02e8e81fa6f37aebebcb01be3fa60ceadecb71008dd405a26"
1719
end
1820

1921
if OS.linux? && Hardware::CPU.intel?
20-
url "https://releases.hashicorp.com/boundary/0.14.1/boundary_0.14.1_linux_amd64.zip"
22+
url release_repository << "/boundary/0.14.1/boundary_0.14.1_linux_amd64.zip"
2123
sha256 "7e422f4b32bfa24ec57ee9979bd6585b7cc2206c6c54b112c7946586d31e327a"
2224
end
2325

2426
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
25-
url "https://releases.hashicorp.com/boundary/0.14.1/boundary_0.14.1_linux_arm.zip"
27+
url release_repository << "/boundary/0.14.1/boundary_0.14.1_linux_arm.zip"
2628
sha256 "d8613e96abdb79ddeb3b9bae7017a6aa3c0a694a572c0fedb5b8430b025051d5"
2729
end
2830

2931
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
30-
url "https://releases.hashicorp.com/boundary/0.14.1/boundary_0.14.1_linux_arm64.zip"
32+
url release_repository << "/boundary/0.14.1/boundary_0.14.1_linux_arm64.zip"
3133
sha256 "cfd5a6be55947b7618875bebc055685477300f272a0b45a0463080300b89b57b"
3234
end
3335

Formula/consul-aws.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class ConsulAws < Formula
2+
release_repository = +ENV["HOMEBREW_HASHICORP_ARTIFACT_REPOSITORY_HOST"] || "https://releases.hashicorp.com"
3+
24
desc "Consul AWS"
35
homepage "https://github.com/hashicorp/consul-aws"
46
version "0.1.2"
@@ -20,12 +22,12 @@ def caveats
2022
end
2123

2224
if OS.linux? && Hardware::CPU.intel?
23-
url "https://releases.hashicorp.com/consul-aws/0.1.2/consul-aws_0.1.2_linux_amd64.zip"
25+
url release_repository << "/consul-aws/0.1.2/consul-aws_0.1.2_linux_amd64.zip"
2426
sha256 "c1a44fd4df8c455a6e4279f83938171087901e17fbff46adbe10c9697fbfb503"
2527
end
2628

2729
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
28-
url "https://releases.hashicorp.com/consul-aws/0.1.2/consul-aws_0.1.2_linux_arm64.zip"
30+
url release_repository << "/consul-aws/0.1.2/consul-aws_0.1.2_linux_arm64.zip"
2931
sha256 "16145d50885aeb6d588b9a35ec4492e5e6960f7c68d4d2f16b0581397e5821f2"
3032
end
3133

Formula/consul-dataplane.rb

+8-6
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,37 @@
22
# SPDX-License-Identifier: MPL-2.0
33

44
class ConsulDataplane < Formula
5+
release_repository = +ENV["HOMEBREW_HASHICORP_ARTIFACT_REPOSITORY_HOST"] || "https://releases.hashicorp.com"
6+
57
desc "Consul Dataplane"
68
homepage "https://github.com/hashicorp/consul-dataplane"
79
version "1.2.2"
810

911
if OS.mac? && Hardware::CPU.intel?
10-
url "https://releases.hashicorp.com/consul-dataplane/1.2.2/consul-dataplane_1.2.2_darwin_amd64.zip"
12+
url release_repository << "/consul-dataplane/1.2.2/consul-dataplane_1.2.2_darwin_amd64.zip"
1113
sha256 "d9942976595c365403d0c0c987c0ab90d430cbd8a3052905ac9ccfa33a5e3b5a"
1214
end
1315

1416
if OS.mac? && Hardware::CPU.arm?
15-
url "https://releases.hashicorp.com/consul-dataplane/1.2.2/consul-dataplane_1.2.2_darwin_arm64.zip"
17+
url release_repository << "/consul-dataplane/1.2.2/consul-dataplane_1.2.2_darwin_arm64.zip"
1618
sha256 "2b61b5cf2bc40bed0d47d3ac5c23d77aa8ec12ce52c45751d8bb9cb857f18c5d"
1719
end
1820

1921
if OS.linux? && Hardware::CPU.intel?
20-
url "https://releases.hashicorp.com/consul-dataplane/1.2.2/consul-dataplane_1.2.2_linux_amd64.zip"
22+
url release_repository << "/consul-dataplane/1.2.2/consul-dataplane_1.2.2_linux_amd64.zip"
2123
sha256 "80e8d1fe00b16ebde6a01aef936c11289ef0477c8fcf035b48bdc63124b62728"
2224
end
2325

2426
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
25-
url "https://releases.hashicorp.com/consul-dataplane/1.2.2/consul-dataplane_1.2.2_linux_arm.zip"
27+
url release_repository << "/consul-dataplane/1.2.2/consul-dataplane_1.2.2_linux_arm.zip"
2628
sha256 "6ac6bec6bd665fc4b7c90aa1b44420f4ba1624f322fac97ff9eceb4f631ba133"
2729
end
2830

2931
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
30-
url "https://releases.hashicorp.com/consul-dataplane/1.2.2/consul-dataplane_1.2.2_linux_arm64.zip"
32+
url release_repository << "/consul-dataplane/1.2.2/consul-dataplane_1.2.2_linux_arm64.zip"
3133
sha256 "05bd53dcedebf21c99363677c90043fce96387b194278518ad47f88bd059b486"
3234
end
33-
35+
3436
depends_on "envoy" => :recommended
3537

3638
conflicts_with "consul-dataplane"

Formula/consul-enterprise.rb

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,34 @@
22
# SPDX-License-Identifier: MPL-2.0
33

44
class ConsulEnterprise < Formula
5+
release_repository = +ENV["HOMEBREW_HASHICORP_ARTIFACT_REPOSITORY_HOST"] || "https://releases.hashicorp.com"
6+
57
desc "Consul Enterprise"
68
homepage "https://www.consul.io"
79
version "1.16.2+ent"
810

911
if OS.mac? && Hardware::CPU.intel?
10-
url "https://releases.hashicorp.com/consul/1.16.2+ent/consul_1.16.2+ent_darwin_amd64.zip"
12+
url release_repository << "/consul/1.16.2+ent/consul_1.16.2+ent_darwin_amd64.zip"
1113
sha256 "86b64e800f4f0e841084ac8f9e3daa7d67fa64a2a3f906f8897379cfbf8c4b96"
1214
end
1315

1416
if OS.mac? && Hardware::CPU.arm?
15-
url "https://releases.hashicorp.com/consul/1.16.2+ent/consul_1.16.2+ent_darwin_arm64.zip"
17+
url release_repository << "/consul/1.16.2+ent/consul_1.16.2+ent_darwin_arm64.zip"
1618
sha256 "bb1b1abecc9cd7faa89a3ad6a91c565c43581353b71cca85dcc81b8d49fa7fd5"
1719
end
1820

1921
if OS.linux? && Hardware::CPU.intel?
20-
url "https://releases.hashicorp.com/consul/1.16.2+ent/consul_1.16.2+ent_linux_amd64.zip"
22+
url release_repository << "/consul/1.16.2+ent/consul_1.16.2+ent_linux_amd64.zip"
2123
sha256 "61194a76ba9294069ce4e7ca4a7ad5e920b4aa4ba0d2d5e2378f48f63f2073ba"
2224
end
2325

2426
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
25-
url "https://releases.hashicorp.com/consul/1.16.2+ent/consul_1.16.2+ent_linux_arm.zip"
27+
url release_repository << "/consul/1.16.2+ent/consul_1.16.2+ent_linux_arm.zip"
2628
sha256 "38335a4bf77f97cb5db22bd966aaa22a023d55b5640f29a2ab360feba83ac254"
2729
end
2830

2931
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
30-
url "https://releases.hashicorp.com/consul/1.16.2+ent/consul_1.16.2+ent_linux_arm64.zip"
32+
url release_repository << "/consul/1.16.2+ent/consul_1.16.2+ent_linux_arm64.zip"
3133
sha256 "705461ac4a91ff5e678160bda0aba1b33da33850f75de068ed0065d30496be03"
3234
end
3335

Formula/consul-esm.rb

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
class ConsulEsm < Formula
2+
release_repository = +ENV["HOMEBREW_HASHICORP_ARTIFACT_REPOSITORY_HOST"] || "https://releases.hashicorp.com"
3+
24
desc "Consul ESM"
35
homepage "https://github.com/hashicorp/consul-esm"
46
version "0.7.1"
57

68
if OS.mac? && Hardware::CPU.intel?
7-
url "https://releases.hashicorp.com/consul-esm/0.7.1/consul-esm_0.7.1_darwin_amd64.zip"
9+
url release_repository << "/consul-esm/0.7.1/consul-esm_0.7.1_darwin_amd64.zip"
810
sha256 "017d94d565dc3c4769472978b033be354ded1a1b8baf1230225587e9453ce5bf"
911
end
1012

1113
if OS.mac? && Hardware::CPU.arm?
12-
url "https://releases.hashicorp.com/consul-esm/0.7.1/consul-esm_0.7.1_darwin_arm64.zip"
14+
url release_repository << "/consul-esm/0.7.1/consul-esm_0.7.1_darwin_arm64.zip"
1315
sha256 "746e127366c94b8fc6838c877c41d26df65a1ca4936dbbddd596b4ef3d5622e9"
1416
end
1517

1618
if OS.linux? && Hardware::CPU.intel?
17-
url "https://releases.hashicorp.com/consul-esm/0.7.1/consul-esm_0.7.1_linux_amd64.zip"
19+
url release_repository << "/consul-esm/0.7.1/consul-esm_0.7.1_linux_amd64.zip"
1820
sha256 "bc1d8c351d277bb1e93d3d2a209b9282ee5d84e3a82ce3c38281f40318b5268f"
1921
end
2022

2123
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
22-
url "https://releases.hashicorp.com/consul-esm/0.7.1/consul-esm_0.7.1_linux_arm.zip"
24+
url release_repository << "/consul-esm/0.7.1/consul-esm_0.7.1_linux_arm.zip"
2325
sha256 "01acf7c989820f399effedd75a3bfa189de5e3853b58bb670b070fd9445f8594"
2426
end
2527

2628
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
27-
url "https://releases.hashicorp.com/consul-esm/0.7.1/consul-esm_0.7.1_linux_arm64.zip"
29+
url release_repository << "/consul-esm/0.7.1/consul-esm_0.7.1_linux_arm64.zip"
2830
sha256 "47e607ef585fb0f4fdffa9de9364e28ecba7a1c9dc80734d4a20f5744d5a37d8"
2931
end
3032

Formula/consul-k8s.rb

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,34 @@
22
# SPDX-License-Identifier: MPL-2.0
33

44
class ConsulK8s < Formula
5+
release_repository = +ENV["HOMEBREW_HASHICORP_ARTIFACT_REPOSITORY_HOST"] || "https://releases.hashicorp.com"
6+
57
desc "Consul K8s"
68
homepage "https://github.com/hashicorp/consul-k8s"
79
version "1.2.2"
810

911
if OS.mac? && Hardware::CPU.intel?
10-
url "https://releases.hashicorp.com/consul-k8s/1.2.2/consul-k8s_1.2.2_darwin_amd64.zip"
12+
url release_repository << "/consul-k8s/1.2.2/consul-k8s_1.2.2_darwin_amd64.zip"
1113
sha256 "303165dad51150d72d10a42b3c23d220780770ea07306d3d18855dfefe587593"
1214
end
1315

1416
if OS.mac? && Hardware::CPU.arm?
15-
url "https://releases.hashicorp.com/consul-k8s/1.2.2/consul-k8s_1.2.2_darwin_arm64.zip"
17+
url release_repository << "/consul-k8s/1.2.2/consul-k8s_1.2.2_darwin_arm64.zip"
1618
sha256 "a614fc0cda1ca790e7f4167bb6d9d9952a5d3c4ac551bcaf3d088c7c17279637"
1719
end
1820

1921
if OS.linux? && Hardware::CPU.intel?
20-
url "https://releases.hashicorp.com/consul-k8s/1.2.2/consul-k8s_1.2.2_linux_amd64.zip"
22+
url release_repository << "/consul-k8s/1.2.2/consul-k8s_1.2.2_linux_amd64.zip"
2123
sha256 "1b4e328a8a4c3d2f0f2f3a1733a71ea304d19631b42d511a7a7c3be3c3a1bc18"
2224
end
2325

2426
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
25-
url "https://releases.hashicorp.com/consul-k8s/1.2.2/consul-k8s_1.2.2_linux_arm.zip"
27+
url release_repository << "/consul-k8s/1.2.2/consul-k8s_1.2.2_linux_arm.zip"
2628
sha256 "8bd4d585e2ea09af3199b853ade9ec5adfd2517a664c05a45642f064a3d00803"
2729
end
2830

2931
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
30-
url "https://releases.hashicorp.com/consul-k8s/1.2.2/consul-k8s_1.2.2_linux_arm64.zip"
32+
url release_repository << "/consul-k8s/1.2.2/consul-k8s_1.2.2_linux_arm64.zip"
3133
sha256 "1352c0297466c2e419dac36a8893fb450e3bec732918dd68bded6b6a4ee60687"
3234
end
3335

Formula/consul-template.rb

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,34 @@
22
# SPDX-License-Identifier: MPL-2.0
33

44
class ConsulTemplate < Formula
5+
release_repository = +ENV["HOMEBREW_HASHICORP_ARTIFACT_REPOSITORY_HOST"] || "https://releases.hashicorp.com"
6+
57
desc "Consul Template"
68
homepage "https://github.com/hashicorp/consul-template"
79
version "0.34.0"
810

911
if OS.mac? && Hardware::CPU.intel?
10-
url "https://releases.hashicorp.com/consul-template/0.34.0/consul-template_0.34.0_darwin_amd64.zip"
12+
url release_repository << "/consul-template/0.34.0/consul-template_0.34.0_darwin_amd64.zip"
1113
sha256 "d0ae649b1bbe1382a8b6ed0252959bebbaf3f8edd28ae68d267056b0b0d3fae4"
1214
end
1315

1416
if OS.mac? && Hardware::CPU.arm?
15-
url "https://releases.hashicorp.com/consul-template/0.34.0/consul-template_0.34.0_darwin_arm64.zip"
17+
url release_repository << "/consul-template/0.34.0/consul-template_0.34.0_darwin_arm64.zip"
1618
sha256 "53b5b84f63487317a1ffde50fba1b92885656c195894a124006985d2957aae6f"
1719
end
1820

1921
if OS.linux? && Hardware::CPU.intel?
20-
url "https://releases.hashicorp.com/consul-template/0.34.0/consul-template_0.34.0_linux_amd64.zip"
22+
url release_repository << "/consul-template/0.34.0/consul-template_0.34.0_linux_amd64.zip"
2123
sha256 "c7a5817547d6545f8c5ce2dfea62c821ddd324dd9a3414519ebaba2aeeff59a0"
2224
end
2325

2426
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
25-
url "https://releases.hashicorp.com/consul-template/0.34.0/consul-template_0.34.0_linux_arm.zip"
27+
url release_repository << "/consul-template/0.34.0/consul-template_0.34.0_linux_arm.zip"
2628
sha256 "5a055fdbdd403b9e68c2ca457c543ebe0b4a4c9af498ff979b206107ced81eb6"
2729
end
2830

2931
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
30-
url "https://releases.hashicorp.com/consul-template/0.34.0/consul-template_0.34.0_linux_arm64.zip"
32+
url release_repository << "/consul-template/0.34.0/consul-template_0.34.0_linux_arm64.zip"
3133
sha256 "90638103f9558b6a152af7245b066472b1ad500332e23d4b6dca1a206f89f4d1"
3234
end
3335

Formula/consul-terraform-sync.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
class ConsulTerraformSync < Formula
2+
release_repository = +ENV["HOMEBREW_HASHICORP_ARTIFACT_REPOSITORY_HOST"] || "https://releases.hashicorp.com"
3+
24
desc "Consul Terraform Sync"
35
homepage "https://github.com/hashicorp/consul-terraform-sync"
46
version "0.7.0"
57

68
if OS.mac?
7-
url "https://releases.hashicorp.com/consul-terraform-sync/0.7.0/consul-terraform-sync_0.7.0_darwin_amd64.zip"
9+
url release_repository << "/consul-terraform-sync/0.7.0/consul-terraform-sync_0.7.0_darwin_amd64.zip"
810
sha256 "dfb11f751de5d8eb5ed19d1aa2ee63a2dda417eea2d900cea6f31ae5b5ea88e6"
911
end
1012

@@ -20,17 +22,17 @@ def caveats
2022
end
2123

2224
if OS.linux? && Hardware::CPU.intel?
23-
url "https://releases.hashicorp.com/consul-terraform-sync/0.7.0/consul-terraform-sync_0.7.0_linux_amd64.zip"
25+
url release_repository << "/consul-terraform-sync/0.7.0/consul-terraform-sync_0.7.0_linux_amd64.zip"
2426
sha256 "40bcb6fa6ab043cad6c7e2425a723f0531b1539ec2502ac2d6fc44180df1efb4"
2527
end
2628

2729
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
28-
url "https://releases.hashicorp.com/consul-terraform-sync/0.7.0/consul-terraform-sync_0.7.0_linux_arm.zip"
30+
url release_repository << "/consul-terraform-sync/0.7.0/consul-terraform-sync_0.7.0_linux_arm.zip"
2931
sha256 "25b3b0b220d6ef31f5864d7babeac24c6cfd5e49f25ed773b14a207d2b127e11"
3032
end
3133

3234
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
33-
url "https://releases.hashicorp.com/consul-terraform-sync/0.7.0/consul-terraform-sync_0.7.0_linux_arm64.zip"
35+
url release_repository << "/consul-terraform-sync/0.7.0/consul-terraform-sync_0.7.0_linux_arm64.zip"
3436
sha256 "6b5adba79bbfd059879572007feb8aec47f61d23f78309b92107f3c403f96703"
3537
end
3638

0 commit comments

Comments
 (0)