Skip to content

Commit

Permalink
Merge pull request #3701 from telepresenceio/thallgren/move-brew-tap
Browse files Browse the repository at this point in the history
Move brew-tap for telepresence-oss to telepresenceio
  • Loading branch information
thallgren authored Oct 8, 2024
2 parents 66c163c + 6cc5de6 commit 3bd1ebb
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 29 deletions.
21 changes: 15 additions & 6 deletions docs/install/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,31 @@ Install the Telepresence client on your workstation by running the commands belo
<Platform.TabGroup>
<Platform.MacOSTab>

## Install with brew:
```shell
# Intel Macs
brew install telepresenceio/telepresence/telepresence-oss
```

## OR download the binary for your platform

# 1. Download the latest binary (~105 MB):
### Intel Macs

```shell
# 1. Download the binary.
sudo curl -fL https://app.getambassador.io/download/tel2oss/releases/download/$dlVersion$/telepresence-darwin-amd64 -o /usr/local/bin/telepresence

# 2. Make the binary executable:
sudo chmod a+x /usr/local/bin/telepresence
```

# Apple silicon Macs
### Apple silicon Macs

```shell
# 1. Ensure that no old binary exists. This is very important because Silicon macs track the executable's signature
# and just updating it in place will not work.
sudo rm -f /usr/local/bin/telepresence
# and just updating it in place will not work.
sudo curl -fL https://app.getambassador.io/download/tel2oss/releases/download/$dlVersion$/telepresence-darwin-amd64 -o /usr/local/bin/telepresence

# 2. Download the latest binary (~101 MB):
# 2. Download the binary.
sudo curl -fL https://app.getambassador.io/download/tel2oss/releases/download/$dlVersion$/telepresence-darwin-arm64 -o /usr/local/bin/telepresence

# 3. Make the binary executable:
Expand Down
23 changes: 16 additions & 7 deletions docs/install/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,36 @@ if your current version is less than 2.8.0).
<Platform.TabGroup>
<Platform.MacOSTab>

## Upgrade with brew:
```shell
# Intel Macs
brew upgrade telepresenceio/telepresence/telepresence-oss
```

## OR upgrade by downloading the binary for your platform

# 1. Download the latest binary (~105 MB):
### Intel Macs

```shell
# 1. Download the binary.
sudo curl -fL https://app.getambassador.io/download/tel2oss/releases/download/$dlVersion$/telepresence-darwin-amd64 -o /usr/local/bin/telepresence

# 2. Make the binary executable:
sudo chmod a+x /usr/local/bin/telepresence
```

# Apple silicon Macs
### Apple silicon Macs

# 1. Remove the old binary. This is very important on Silicon macs, because they keep track of the binary signature
sudo rm /usr/local/bin/telepresence
```shell
# 1. Ensure that no old binary exists. This is very important because Silicon macs track the executable's signature
# and just updating it in place will not work.
sudo curl -fL https://app.getambassador.io/download/tel2oss/releases/download/$dlVersion$/telepresence-darwin-amd64 -o /usr/local/bin/telepresence

# 2. Download the latest binary (~101 MB):
# 2. Download the binary.
sudo curl -fL https://app.getambassador.io/download/tel2oss/releases/download/$dlVersion$/telepresence-darwin-arm64 -o /usr/local/bin/telepresence

# 3. Make the binary executable:
sudo chmod a+x /usr/local/bin/telepresence
```

</Platform.MacOSTab>
<Platform.GNULinuxTab>

Expand Down
8 changes: 4 additions & 4 deletions packaging/homebrew-formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class __FORMULA_NAME__ < Formula
#depends_on "macfuse"

if Hardware::CPU.arm?
url "https://app.getambassador.io/download/tel2/darwin/arm64/__NEW_VERSION__/telepresence"
url "https://app.getambassador.io/download/tel2/darwin/arm64/v__NEW_VERSION__/telepresence"
sha256 "__TARBALL_HASH_DARWIN_ARM64__"

def install
Expand All @@ -34,7 +34,7 @@ def install
end
end
if Hardware::CPU.intel?
url "https://app.getambassador.io/download/tel2/darwin/amd64/__NEW_VERSION__/telepresence"
url "https://app.getambassador.io/download/tel2/darwin/amd64/v__NEW_VERSION__/telepresence"
sha256 "__TARBALL_HASH_DARWIN_AMD64__"

def install
Expand All @@ -58,7 +58,7 @@ def install

on_linux do
# if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
# url "https://app.getambassador.io/download/tel2/linux/arm64/__NEW_VERSION__/telepresence"
# url "https://app.getambassador.io/download/tel2/linux/arm64/v__NEW_VERSION__/telepresence"
# sha256 "__TARBALL_HASH_LINUX_ARM64__"

# def install
Expand All @@ -78,7 +78,7 @@ def install
# end
# end
if Hardware::CPU.intel?
url "https://app.getambassador.io/download/tel2/linux/amd64/__NEW_VERSION__/telepresence"
url "https://app.getambassador.io/download/tel2/linux/amd64/v__NEW_VERSION__/telepresence"
sha256 "__TARBALL_HASH_LINUX_AMD64__"

def install
Expand Down
2 changes: 1 addition & 1 deletion packaging/homebrew-oss-formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class __FORMULA_NAME__ < Formula
OPERATING_SYSTEM = OS.mac? ? "darwin" : "linux"
PACKAGE_NAME = "telepresence-#{OPERATING_SYSTEM}-#{ARCH}"

url "#{BASE_URL}/#{version}/#{PACKAGE_NAME}"
url "#{BASE_URL}/v#{version}/#{PACKAGE_NAME}"

sha256 "__TARBALL_HASH_DARWIN_AMD64__" if OS.mac? && Hardware::CPU.intel?
sha256 "__TARBALL_HASH_DARWIN_ARM64__" if OS.mac? && Hardware::CPU.arm?
Expand Down
19 changes: 8 additions & 11 deletions packaging/homebrew-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ echo "Working in ${WORK_DIR}"

BUILD_HOMEBREW_DIR=${WORK_DIR}/homebrew
if [ "${PACKAGE_NAME}" == 'tel2' ]; then
FORMULA="${BUILD_HOMEBREW_DIR}/Formula/telepresence.rb"
FORMULA_NAME="Telepresence"
FORMULA_FILE="packaging/homebrew-formula.rb"
FORMULA="${BUILD_HOMEBREW_DIR}/Formula/telepresence.rb"
elif [ "${PACKAGE_NAME}" == 'tel2oss' ]; then
FORMULA="${BUILD_HOMEBREW_DIR}/Formula/telepresence-oss.rb"
FORMULA_NAME="Telepresence OSS"
FORMULA_NAME="TelepresenceOss"
FORMULA_FILE="packaging/homebrew-oss-formula.rb"
FORMULA="${BUILD_HOMEBREW_DIR}/Formula/telepresence-oss.rb"
fi

for this_os in "${OS[@]}"; do
Expand All @@ -38,7 +38,7 @@ for this_os in "${OS[@]}"; do
# We should only be updating homebrew with a version of telepresence that
# already exists, so let's download it
if [ "${PACKAGE_NAME}" == 'tel2' ]; then
DOWNLOAD_PATH="/download/${PACKAGE_NAME}/${this_os}/${this_arch}/${VERSION}/telepresence"
DOWNLOAD_PATH="/download/${PACKAGE_NAME}/${this_os}/${this_arch}/v${VERSION}/telepresence"
elif [ "${PACKAGE_NAME}" == 'tel2oss' ]; then
DOWNLOAD_PATH="/download/${PACKAGE_NAME}/releases/download/v${VERSION}/telepresence-${this_os}-${this_arch}"
fi
Expand Down Expand Up @@ -79,11 +79,12 @@ if [ "${HASH_ERRORS}" -gt 0 ]; then
exit 1
fi

# Clone blackbird-homebrew:
# Clone telepresenceio-homebrew:
echo "Cloning into ${BUILD_HOMEBREW_DIR}..."
git clone https://github.com/datawire/homebrew-blackbird.git "${BUILD_HOMEBREW_DIR}"
git clone https://github.com/telepresenceio/homebrew-telepresence.git "${BUILD_HOMEBREW_DIR}"

# Update recipe
mkdir -p "$(dirname "${FORMULA}")"
cp "${FORMULA_FILE}" "${FORMULA}"

sed -i'' -e "s/__FORMULA_NAME__/${FORMULA_NAME}/g" "${FORMULA}"
Expand All @@ -104,10 +105,6 @@ done
chmod 644 "${FORMULA}"
cd "${BUILD_HOMEBREW_DIR}"

# Use the correct machine user for committing
git config user.email "[email protected]"
git config user.name "d6e automaton"

git add "${FORMULA}"
git commit -m "Release ${VERSION}"

Expand All @@ -116,7 +113,7 @@ git commit -m "Release ${VERSION}"
# the change. Once we know the automation is working, we can
# remove it.
cat "${FORMULA}"
git push origin master
git push origin main

# Clean up the working directory
rm -rf "${WORK_DIR}"

0 comments on commit 3bd1ebb

Please sign in to comment.