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

bump scw to v.1.19 #12

Merged
merged 1 commit into from
Aug 1, 2019
Merged
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
29 changes: 13 additions & 16 deletions scw.rb
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
require "language/go"

class Scw < Formula
desc "Manage BareMetal Servers from Command Line (as easily as with Docker)"
desc "Manage BareMetal Servers from command-line (as easily as with Docker)"
homepage "https://github.com/scaleway/scaleway-cli"
url "https://github.com/scaleway/scaleway-cli/archive/v1.12.tar.gz"
sha256 "7a23ef6960fe280dd19f8e2e9b0fff6ffaf4b8446ddc7833b530901875652e2e"
version "1.12"

url "https://github.com/scaleway/scaleway-cli/archive/v1.19.tar.gz"
sha256 "307bb2a67cd8b8a7fb58524dfe3f65bbba476496c051e289e76f11d0508a0ab7"
head "https://github.com/scaleway/scaleway-cli.git"

bottle do
cellar :any_skip_relocation
sha256 "57a21449714df68f713fba876e8c2b4a62de751fd48cd51c15b5109d4a6fb74f" => :mojave
sha256 "f292e2359a0f203d78598f08c36c333a7e418bdd2da019dcb12b4a662b1d2e36" => :high_sierra
sha256 "585ec2a43d879705288fc165ca77f19d027976da976e38e72874b1273128c790" => :sierra
end

depends_on "go" => :build

def install
ENV["GOPATH"] = buildpath
ENV["GOBIN"] = buildpath
ENV["GO15VENDOREXPERIMENT"] = "1"
(buildpath/"src/github.com/scaleway/scaleway-cli").install Dir["*"]

system "go", "build", "-o", "#{bin}/scw", "-v", "-ldflags", "-X github.com/scaleway/scaleway-cli/pkg/scwversion.GITCOMMIT=homebrew", "github.com/scaleway/scaleway-cli/cmd/scw/"
# we remove our .scw-cache.db file, to clean the cache of scw
# this file is created and handled by scw
rm_f "~/.scw-cache.db"
system "go", "build", "-o", "#{bin}/scw", "-v", "-ldflags",
"-X github.com/scaleway/scaleway-cli/pkg/scwversion.GITCOMMIT=homebrew",
"github.com/scaleway/scaleway-cli/cmd/scw/"

bash_completion.install "src/github.com/scaleway/scaleway-cli/contrib/completion/bash/scw.bash"
zsh_completion.install "src/github.com/scaleway/scaleway-cli/contrib/completion/zsh/_scw"
end

def caveats
"Use `scw login` to set up the correct environment to use scaleway-cli."
end

test do
output = shell_output(bin/"scw version")
assert_match "OS/Arch (client): darwin/amd64", output
Expand Down