forked from okteto/okteto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_homebrew_formula.sh
executable file
·51 lines (41 loc) · 1.05 KB
/
update_homebrew_formula.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# !/bin/sh
set -e
VERSION=$1
SHA=$2
if [ -z "$VERSION" ]; then
echo "missing version"
exit 1
fi
if [ -z "$SHA" ]; then
echo "missing sha"
exit 1
fi
rm -rf homebrew-cli
git clone --depth 1 https://github.com/okteto/homebrew-cli.git
pushd homebrew-cli
cat << EOF > Formula/okteto.rb
class Okteto < Formula
desc "CLI for cloud native development"
homepage "https://okteto.com"
url "https://github.com/okteto/okteto/releases/download/$VERSION/okteto-Darwin-x86_64"
sha256 "$SHA"
version "$VERSION"
head do
url "https://downloads.okteto.com/cli/master/okteto-Darwin-x86_64"
end
def install
bin.install "okteto-Darwin-x86_64"
mv bin/"okteto-Darwin-x86_64", bin/"okteto"
end
# Homebrew requires tests.
test do
assert_match "okteto version $VERSION", shell_output("#{bin}/okteto version 2>&1", 0)
end
end
EOF
cat Formula/okteto.rb
git add Formula/okteto.rb
git config user.name "okteto"
git config user.email "[email protected]"
git commit -m "$VERSION release"
git --no-pager log -1