Skip to content

Instantly share code, notes, and snippets.

@jensim
Last active November 16, 2023 19:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jensim/3fc69962914f3734c8738c8163b118c4 to your computer and use it in GitHub Desktop.
Save jensim/3fc69962914f3734c8738c8163b118c4 to your computer and use it in GitHub Desktop.
private git repo homebrew tap template

Closed source distribution of scripts via homebrew

Why?

Manual work is a bug. so, have someone automate the crap out of your migrations (or w/e task you are drowning in) in script-form, and deliver it like superpowers to all your developers with a tool they already know how to use.
Brew has built in updateability.

# Tap it
brew tap jensim/demo ssh://git@my.bitbucket.server.com:2222/~jensim/homebrew-demo.git
# Install it
brew install jensim_demo_formula
# Run it
jensim_demo_formula
# Located in the Tap git repo
# ssh://git@my.bitbucket.server.com:2222/~jensim/homebrew-demo.git
# in the catalogue 'Fomula'
# And the file-name must match the ruby-class
# You can also have multiple Formula definitions in the same tap
class JensimDemoFormula < Formula
desc 'A demo formula'
homepage 'https://my.bitbucket.server.com/users/jensim/repos/demo-repo/browse'
head 'ssh://git@my.bitbucket.server.com:2200/~jensim/demo-repo.git', :using => :git
url 'ssh://git@my.bitbucket.server.com:2200/~jensim/demo-repo.git', :using => :git, :tag => '0.0.1'
version '0.0.1'
depends_on 'gnu-sed'
def install
bin.install 'script.sh' => 'jensim_demo_formula'
prefix.install 'files'
end
end
#!/bin/bash
# Located in the formula git-repo
# ssh://git@my.bitbucket.server.com:2200/~jensim/demo-repo.git
echo >&2 'Hello world'
# Do stuff...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment