Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate multiarch formula with new templater #133

Merged
merged 1 commit into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions Formula/boundary.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
class Boundary < Formula
desc "Boundary"
homepage "https://www.boundaryproject.io/"
version "0.1.8"

url "https://releases.hashicorp.com/boundary/0.1.8/boundary_0.1.8_darwin_amd64.zip"
if OS.mac? && Hardware::CPU.intel?
url "https://releases.hashicorp.com/boundary/0.1.8/boundary_0.1.8_darwin_amd64.zip"
sha256 "decc37dbaf7723cd9b08b005e0b050a0f34334cf198f9553af5d63e133eea33f"
end

if OS.linux? && Hardware::CPU.intel?
url "https://releases.hashicorp.com/boundary/0.1.8/boundary_0.1.8_linux_amd64.zip"
sha256 "22afe6070391c9d5a5d14e32a7b438b7ccd200e4d68862c1f10145f1afb09302"
end

if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
url "https://releases.hashicorp.com/boundary/0.1.8/boundary_0.1.8_linux_arm.zip"
sha256 "ee0801e58ca9a082b91fd9328a2623c110d805da2cdc821ccd2c3e17a81d3151"
end

if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://releases.hashicorp.com/boundary/0.1.8/boundary_0.1.8_linux_arm64.zip"
sha256 "7e6d3820a78468f44f3c78c6f78be22b31d1b3054e15f79d940197efcd28edf2"
end

version "0.1.8"
sha256 "decc37dbaf7723cd9b08b005e0b050a0f34334cf198f9553af5d63e133eea33f"
bottle :unneeded

# conflicts_with "boundary"
conflicts_with "boundary"

def install
bin.install "boundary"
Expand Down
83 changes: 48 additions & 35 deletions Formula/consul.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
class Consul < Formula
desc "Consul"
homepage "https://www.consul.io"

url "https://releases.hashicorp.com/consul/1.9.4/consul_1.9.4_darwin_amd64.zip"
version "1.9.4"
sha256 "c168240d52f67c71b30ef51b3594673cad77d0dbbf38c412b2ee30b39ef30843"

if OS.mac? && Hardware::CPU.intel?
url "https://releases.hashicorp.com/consul/1.9.4/consul_1.9.4_darwin_amd64.zip"
sha256 "c168240d52f67c71b30ef51b3594673cad77d0dbbf38c412b2ee30b39ef30843"
end

if OS.linux? && Hardware::CPU.intel?
url "https://releases.hashicorp.com/consul/1.9.4/consul_1.9.4_linux_amd64.zip"
sha256 "da3919197ef33c4205bb7df3cc5992ccaae01d46753a72fe029778d7f52fb610"
end

if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://releases.hashicorp.com/consul/1.9.4/consul_1.9.4_linux_arm64.zip"
sha256 "012c552aff502f907416c9a119d2dfed88b92e981f9b160eb4fe292676afdaeb"
end

bottle :unneeded

conflicts_with "consul"
Expand All @@ -15,38 +28,38 @@ def install

plist_options manual: "consul agent -dev -bind 127.0.0.1"

def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/consul</string>
<string>agent</string>
<string>-dev</string>
<string>-bind</string>
<string>127.0.0.1</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{var}</string>
<key>StandardErrorPath</key>
<string>#{var}/log/consul.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/consul.log</string>
</dict>
</plist>
EOS
def plist; <<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/consul</string>
<string>agent</string>
<string>-dev</string>
<string>-bind</string>
<string>127.0.0.1</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{var}</string>
<key>StandardErrorPath</key>
<string>#{var}/log/consul.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/consul.log</string>
</dict>
</plist>

EOS
end

test do
Expand Down
84 changes: 51 additions & 33 deletions Formula/nomad.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
class Nomad < Formula
desc "Nomad"
homepage "https://www.nomadproject.io/"

url "https://releases.hashicorp.com/nomad/1.0.4/nomad_1.0.4_darwin_amd64.zip"
version "1.0.4"
sha256 "329f9ffca0dc709d04ba465d2dd3b12f54cf2e5f8b1ae169e4313239ada3e5b5"

if OS.mac? && Hardware::CPU.intel?
url "https://releases.hashicorp.com/nomad/1.0.4/nomad_1.0.4_darwin_amd64.zip"
sha256 "329f9ffca0dc709d04ba465d2dd3b12f54cf2e5f8b1ae169e4313239ada3e5b5"
end

if OS.linux? && Hardware::CPU.intel?
url "https://releases.hashicorp.com/nomad/1.0.4/nomad_1.0.4_linux_amd64.zip"
sha256 "dbb8b8b1366c8ea9504cc396f2c00a254e043b1fc9f39f39d9ef3398e454e840"
end

if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
url "https://releases.hashicorp.com/nomad/1.0.4/nomad_1.0.4_linux_arm.zip"
sha256 "69cf7a6e5f4bd2c82439bc222f0ede07400701431ecd8754bd80564fa08cbf0a"
end

if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://releases.hashicorp.com/nomad/1.0.4/nomad_1.0.4_linux_arm64.zip"
sha256 "f7b03c7bca6e631aa72cd8128204636179496a5f29b1e82553a40aa809a4a6c9"
end

bottle :unneeded

conflicts_with "nomad"
Expand All @@ -15,36 +33,36 @@ def install

plist_options manual: "nomad agent -dev"

def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/nomad</string>
<string>agent</string>
<string>-dev</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{var}</string>
<key>StandardErrorPath</key>
<string>#{var}/log/nomad.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/nomad.log</string>
</dict>
</plist>
EOS
def plist; <<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/nomad</string>
<string>agent</string>
<string>-dev</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{var}</string>
<key>StandardErrorPath</key>
<string>#{var}/log/nomad.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/nomad.log</string>
</dict>
</plist>

EOS
end

test do
Expand Down
29 changes: 26 additions & 3 deletions Formula/packer.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
class Packer < Formula
desc "Packer"
homepage "https://www.packer.io/"

url "https://releases.hashicorp.com/packer/1.7.1/packer_1.7.1_darwin_amd64.zip"
version "1.7.1"
sha256 "df4fce2ee7bfc7dbb636d9dc6c7fa1c998e3a526dd6c804998e86a2ee30c800f"

if OS.mac? && Hardware::CPU.intel?
url "https://releases.hashicorp.com/packer/1.7.1/packer_1.7.1_darwin_amd64.zip"
sha256 "df4fce2ee7bfc7dbb636d9dc6c7fa1c998e3a526dd6c804998e86a2ee30c800f"
end

if OS.mac? && Hardware::CPU.arm?
url "https://releases.hashicorp.com/packer/1.7.1/packer_1.7.1_darwin_arm64.zip"
sha256 "ea6b46c9fcc668393182192f3ec60162cc41922c49cf1b3db4e8daa097a426e8"
end

if OS.linux? && Hardware::CPU.intel?
url "https://releases.hashicorp.com/packer/1.7.1/packer_1.7.1_linux_amd64.zip"
sha256 "1afd50d8cd30290d569e07548fecfb4fe8c95994740acbc3a5b2c2246268a026"
end

if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
url "https://releases.hashicorp.com/packer/1.7.1/packer_1.7.1_linux_arm.zip"
sha256 "a92a3c28e1bbc573b6dc0c09a25fa48514c5d7d3c910048a99d4e84905bcd88d"
end

if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://releases.hashicorp.com/packer/1.7.1/packer_1.7.1_linux_arm64.zip"
sha256 "356edb9f326a9c44a57858d36fa60881fbef109ef52028634e92b73f2464c210"
end

bottle :unneeded

conflicts_with "packer"
Expand Down
24 changes: 21 additions & 3 deletions Formula/terraform.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
class Terraform < Formula
desc "Terraform"
homepage "https://www.terraform.io/"

url "https://releases.hashicorp.com/terraform/0.14.9/terraform_0.14.9_darwin_amd64.zip"
version "0.14.9"
sha256 "96d0b1c807415ba295a70e8afed04e233778673103587f321164ebb96be123d8"

if OS.mac? && Hardware::CPU.intel?
url "https://releases.hashicorp.com/terraform/0.14.9/terraform_0.14.9_darwin_amd64.zip"
sha256 "96d0b1c807415ba295a70e8afed04e233778673103587f321164ebb96be123d8"
end

if OS.linux? && Hardware::CPU.intel?
url "https://releases.hashicorp.com/terraform/0.14.9/terraform_0.14.9_linux_amd64.zip"
sha256 "47e097cfbfb64e97492934f50e646cb84df952eb76897182557811b45603dbf0"
end

if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
url "https://releases.hashicorp.com/terraform/0.14.9/terraform_0.14.9_linux_arm.zip"
sha256 "a58df5be281c7e2c0627cf15f755634201220f0c55ce30c7b37d3fc088bd3ef2"
end

if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://releases.hashicorp.com/terraform/0.14.9/terraform_0.14.9_linux_arm64.zip"
sha256 "5bcdaf46927edcc46f063faef02878620b137a84a4523004c70b6ab05b20a15c"
end

bottle :unneeded

conflicts_with "terraform"
Expand Down
Loading