Skip to content

Commit

Permalink
Merge pull request #20 from rothgar/patch-1
Browse files Browse the repository at this point in the history
Support homebrew on linux with formula
  • Loading branch information
tomzo authored Sep 6, 2020
2 parents 9121589 + e73b005 commit b39095b
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tasks
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,36 @@ const DojoVersion = \"${next_version}\"
;;
homebrew_tap)
if [ ! -f bin/dojo_darwin_amd64 ]; then echo "dojo_darwin_amd64 binary does not exist"; exit 1; fi
SHA256=$(sha256sum bin/dojo_darwin_amd64 | awk '{printf $1}')
if [ ! -f bin/dojo_linux_amd64 ]; then echo "dojo_linux_amd64 binary does not exist"; exit 1; fi
DARWIN_SHA256=$(sha256sum bin/dojo_darwin_amd64 | awk '{printf $1}')
LINUX_SHA256=$(sha256sum bin/dojo_linux_amd64 | awk '{printf $1}')
VERSION="$(releaser::get_last_version_from_whole_changelog ${changelog_file})"
git clone [email protected]:kudulab/homebrew-dojo-osx.git homebrew-dojo-osx
cd homebrew-dojo-osx
cat << EOF > dojo.rb
class Dojo < Formula
desc "Containerize your development and operations environment"
homepage "https://github.com/kudulab/dojo"
url "https://github.com/kudulab/dojo/releases/download/${VERSION}/dojo_darwin_amd64"
sha256 "${SHA256}"
version "${VERSION}"
bottle :unneeded
if OS.mac?
url "https://github.com/kudulab/dojo/releases/download/${VERSION}/dojo_darwin_amd64"
sha256 "${DARWIN_SHA256}"
def install
bin.install "dojo_darwin_amd64"
mv bin/"dojo_darwin_amd64", bin/"dojo"
end
elsif OS.linux?
if Hardware::CPU.intel?
url "https://github.com/kudulab/dojo/releases/download/${VERSION}/dojo_linux_amd64"
sha256 "${LINUX_SHA256}"
def install
bin.install "dojo_linux_amd64"
mv bin/"dojo_linux_amd64", bin/"dojo"
end
end
end
end
EOF
git add dojo.rb
Expand Down

0 comments on commit b39095b

Please sign in to comment.