Formula/hubctl.rb (61 lines of code) (raw):
# typed: false
# frozen_string_literal: true
# This file was generated by GoReleaser. DO NOT EDIT.
class Hubctl < Formula
desc "Hub CTL is stack composition and lifecycle tool."
homepage "https://hubctl.io/"
version "1.0.14"
license "MPL-2.0"
depends_on "jq"
depends_on "npm" => :optional
depends_on "yq"
on_macos do
if Hardware::CPU.intel?
url "https://github.com/epam/hubctl/releases/download/v1.0.14/hubctl_Darwin_x86_64.tar.gz"
sha256 "cd4dbe6a9293316bd2f4635e6835a8118f72124633ab2cc9192c8d032f722c4f"
def install
bin.install "hubctl"
end
end
if Hardware::CPU.arm?
url "https://github.com/epam/hubctl/releases/download/v1.0.14/hubctl_Darwin_arm64.tar.gz"
sha256 "3caa0dece36a0c200db7f2772bf3dbafc2cfd60dd9f45f1a14768c3a937b6b59"
def install
bin.install "hubctl"
end
end
end
on_linux do
if Hardware::CPU.intel?
url "https://github.com/epam/hubctl/releases/download/v1.0.14/hubctl_Linux_x86_64.tar.gz"
sha256 "ebd3bc06c277dbe5ae6248d92f59bfb953069c31a7802e6c7da2c3afdc999956"
def install
bin.install "hubctl"
end
end
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://github.com/epam/hubctl/releases/download/v1.0.14/hubctl_Linux_arm64.tar.gz"
sha256 "76ab7a3331fa01aa5d464e114bf1d9fb009a41a4e1c6bb282af5cf5bec543f4a"
def install
bin.install "hubctl"
end
end
end
head "https://github.com/epam/hubctl"
def post_install
hub_home = Pathname.new "#{Dir.home}/.hub"
unless hub_home.exist?
system "#{Formula["hub"].opt_bin}/hubctl", "extensions", "install"
end
end
def caveats
<<~EOS
hubctl version
hubctl help
hubctl elaborate hub.yaml params.yaml -o hub.yaml.elaborate
hubctl deploy hub.yaml.elaborate -e NAME=stage
EOS
end
test do
output = shell_output("#{bin}/hubctl version").chomp
assert output.start_with?("Hub CTL git ")
system "false"
end
end