Skip to content

Commit

Permalink
atlantis: vendor terraform
Browse files Browse the repository at this point in the history
This is the last formula in homebrew-core that needs terraform.
Vendor it until upstream allows to use openTofu
  • Loading branch information
iMichka committed Apr 3, 2024
1 parent 019f687 commit 631a9a0
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Formula/a/atlantis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Atlantis < Formula
url "https://github.com/runatlantis/atlantis/archive/refs/tags/v0.27.2.tar.gz"
sha256 "e44a53d4fa43cdaa88a2e7734da2854a97b1b555a425ab26ac5787ef9f3d3076"
license "Apache-2.0"
revision 1
head "https://github.com/runatlantis/atlantis.git", branch: "main"

livecheck do
Expand All @@ -22,10 +23,24 @@ class Atlantis < Formula
end

depends_on "go" => :build
depends_on "terraform"

resource "terraform" do
# https://www.hashicorp.com/blog/hashicorp-adopts-business-source-license
# Do not update terraform, it switched to the BUSL license
# Waiting for https://github.com/runatlantis/atlantis/issues/3741
url "https://github.com/hashicorp/terraform/archive/refs/tags/v1.5.7.tar.gz"
sha256 "6742fc87cba5e064455393cda12f0e0241c85a7cb2a3558d13289380bb5f26f5"
end

def install
system "go", "build", *std_go_args(ldflags: "-s -w")
resource("terraform").stage do
system "go", "build", *std_go_args(ldflags: "-s -w", output: libexec/"bin/terraform")
end

system "go", "build", *std_go_args(ldflags: "-s -w", output: libexec/"bin/atlantis")

env = { PATH: libexec/"bin" }
(bin/"atlantis").write_env_script libexec/"bin/atlantis", env
end

test do
Expand Down

0 comments on commit 631a9a0

Please sign in to comment.