-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automated version bumping - splits formula into multiple files based …
…on OS platform
- Loading branch information
Showing
5 changed files
with
74 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,32 @@ | ||
class Pvsadm < Formula | ||
desc "Tool for managing the IBM Power Systems Virtual Servers" | ||
homepage "https://github.com/ppc64le-cloud/pvsadm" | ||
version "0.1.11" | ||
license "Apache-2.0" | ||
on_macos do | ||
on_intel do | ||
url "https://github.com/ppc64le-cloud/pvsadm/releases/download/v0.1.11/pvsadm-darwin-amd64.tar.gz" | ||
sha256 "7af9d26b61a032f874be6d5a040b762796651bfde1acf95188b23ad85de1a646" | ||
end | ||
|
||
on_arm do | ||
url "https://github.com/ppc64le-cloud/pvsadm/releases/download/v0.1.11/pvsadm-darwin-arm64.tar.gz" | ||
sha256 "053068fbfe6b6ea83fe285a22e0c260651714a976aee3d2c2be6529f2fbfc5f3" | ||
if OS.mac? | ||
if Hardware::CPU.intel? | ||
require_relative "pvsadm_darwin_amd64" | ||
PvsadmDarwinAmd64.new | ||
elsif Hardware::CPU.arm? | ||
require_relative "pvsadm_darwin_arm64" | ||
PvsadmDarwinArm64.new | ||
end | ||
end | ||
|
||
on_linux do | ||
on_intel do | ||
url "https://github.com/ppc64le-cloud/pvsadm/releases/download/v0.1.11/pvsadm-linux-amd64.tar.gz" | ||
sha256 "b25e9453bdd75a11af3303783c250c93f05b3472cfe49e795bab200e5db04e03" | ||
elsif OS.linux? | ||
if Hardware::CPU.intel? | ||
require_relative "pvsadm_linux_amd64" | ||
PvsadmLinuxAmd64.new | ||
end | ||
end | ||
|
||
def install | ||
bin.install "pvsadm" | ||
raise "Unsupported platform" unless defined? @formula | ||
|
||
@formula.install | ||
end | ||
|
||
test do | ||
output = shell_output("#{bin}/pvsadm get events 2>&1", 1) | ||
assert_match "Error: --instance-name or --instance-name required", output | ||
assert_match "Version: v#{version},", shell_output("#{bin}/pvsadm version | awk '{print $1, $2}'") | ||
raise "Unsupported platform" unless defined? @formula | ||
|
||
@formula.test | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class PvsadmDarwinAmd64 < Formula | ||
desc "Tool for managing the IBM Power Systems Virtual Servers" | ||
homepage "https://github.com/ppc64le-cloud/pvsadm" | ||
url "https://github.com/ppc64le-cloud/pvsadm/releases/download/v0.1.11/pvsadm-darwin-amd64.tar.gz" | ||
version "v0.1.11" | ||
sha256 "7af9d26b61a032f874be6d5a040b762796651bfde1acf95188b23ad85de1a646" | ||
license "Apache-2.0" | ||
|
||
def install | ||
bin.install "pvsadm" | ||
end | ||
|
||
test do | ||
output = shell_output("#{bin}/pvsadm get events 2>&1", 1) | ||
assert_match "Error: --instance-name or --instance-name required", output | ||
assert_match "Version: v#{version},", shell_output("#{bin}/pvsadm version | awk '{print $1, $2}'") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class PvsadmDarwinArm64 < Formula | ||
desc "Tool for managing the IBM Power Systems Virtual Servers" | ||
homepage "https://github.com/ppc64le-cloud/pvsadm" | ||
url "https://github.com/ppc64le-cloud/pvsadm/releases/download/v0.1.11/pvsadm-darwin-arm64.tar.gz" | ||
version "0.1.11" | ||
sha256 "053068fbfe6b6ea83fe285a22e0c260651714a976aee3d2c2be6529f2fbfc5f3" | ||
license "Apache-2.0" | ||
|
||
def install | ||
bin.install "pvsadm" | ||
end | ||
|
||
test do | ||
output = shell_output("#{bin}/pvsadm get events 2>&1", 1) | ||
assert_match "Error: --instance-name or --instance-name required", output | ||
assert_match "Version: v#{version},", shell_output("#{bin}/pvsadm version | awk '{print $1, $2}'") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class PvsadmLinuxAmd64 < Formula | ||
desc "Tool for managing the IBM Power Systems Virtual Servers" | ||
homepage "https://github.com/ppc64le-cloud/pvsadm" | ||
url "https://github.com/ppc64le-cloud/pvsadm/releases/download/v0.1.11/pvsadm-linux-amd64.tar.gz" | ||
version "0.1.11" | ||
sha256 "b25e9453bdd75a11af3303783c250c93f05b3472cfe49e795bab200e5db04e03" | ||
license "Apache-2.0" | ||
|
||
def install | ||
bin.install "pvsadm" | ||
end | ||
|
||
test do | ||
output = shell_output("#{bin}/pvsadm get events 2>&1", 1) | ||
assert_match "Error: --instance-name or --instance-name required", output | ||
assert_match "Version: v#{version},", shell_output("#{bin}/pvsadm version | awk '{print $1, $2}'") | ||
end | ||
end |