2019-10-14 17:23:07 +00:00
|
|
|
class Awsume < Formula
|
|
|
|
include Language::Python::Virtualenv
|
|
|
|
|
|
|
|
desc "Utility for easily assuming AWS IAM roles from the command-line"
|
|
|
|
homepage "https://www.trek10.com/blog/awsume-aws-assume-made-awesome"
|
2019-12-01 22:25:35 +00:00
|
|
|
url "https://github.com/trek10inc/awsume/archive/4.1.10.tar.gz"
|
|
|
|
sha256 "962b4f7ce25c4647fdc5c286a78cc8a1bf65d75e799116084b4b362a63ef7eb2"
|
2019-10-14 17:23:07 +00:00
|
|
|
head "https://github.com/trek10inc/awsume.git"
|
|
|
|
|
2019-10-21 19:00:04 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2019-12-01 22:39:19 +00:00
|
|
|
sha256 "6b0dba57fd46e839c5c1a06e61845e9540b5bfeb731e7cead4e1690f0b5fff1b" => :catalina
|
|
|
|
sha256 "44ba1d3057fd94aa715e2ccae140088bf382fa1e1b0cb519baf9621fd1f54902" => :mojave
|
|
|
|
sha256 "4799a2384a87f2c15ea5eec27a24887a55063d0c859d616c06fd2990f21e6bbb" => :high_sierra
|
2019-10-21 19:00:04 +00:00
|
|
|
end
|
|
|
|
|
2019-11-18 10:36:54 +00:00
|
|
|
depends_on "openssl@1.1"
|
2019-10-14 17:23:07 +00:00
|
|
|
depends_on "python"
|
|
|
|
uses_from_macos "sqlite"
|
|
|
|
|
|
|
|
def install
|
|
|
|
venv = virtualenv_create(libexec, "python3")
|
|
|
|
system libexec/"bin/pip", "install", "-v", "--no-binary", ":all:",
|
|
|
|
"--ignore-installed", buildpath
|
|
|
|
system libexec/"bin/pip", "uninstall", "-y", "awsume"
|
|
|
|
venv.pip_install_and_link buildpath
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
assert_includes "4.0.0", shell_output("#{bin}/awsume -v")
|
2019-12-01 22:25:35 +00:00
|
|
|
|
2019-10-14 17:23:07 +00:00
|
|
|
file_path = File.expand_path("~/.awsume/config.yaml")
|
|
|
|
shell_output(File.exist?(file_path))
|
2019-12-01 22:25:35 +00:00
|
|
|
|
|
|
|
assert_match "PROFILE TYPE SOURCE MFA? REGION ACCOUNT", shell_output("#{bin}/awsume --list-profiles 2>&1")
|
2019-10-14 17:23:07 +00:00
|
|
|
end
|
|
|
|
end
|