2019-02-15 13:40:41 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-02-21 12:32:23 +00:00
|
|
|
# silence bundler complaining about being root
|
|
|
|
mkdir ~/.bundle
|
|
|
|
echo 'BUNDLE_SILENCE_ROOT_WARNING: "1"' > ~/.bundle/config
|
|
|
|
|
|
|
|
# configure git
|
|
|
|
git config --global user.name "BrewTestBot"
|
|
|
|
git config --global user.email "homebrew-test-bot@lists.sfconservancy.org"
|
2019-02-15 15:07:34 +00:00
|
|
|
|
|
|
|
# create stubs so build dependencies aren't incorrectly flagged as missing
|
|
|
|
for i in python svn unzip xz
|
|
|
|
do
|
2019-02-21 12:32:23 +00:00
|
|
|
touch /usr/bin/$i
|
|
|
|
chmod +x /usr/bin/$i
|
2019-02-15 15:07:34 +00:00
|
|
|
done
|
|
|
|
|
2019-02-21 12:32:23 +00:00
|
|
|
# setup Homebrew/homebrew-core instead of Linuxbrew's
|
|
|
|
CORE_DIR="$(brew --repo homebrew/core)"
|
|
|
|
mkdir -p "$CORE_DIR"
|
|
|
|
rm -rf "$CORE_DIR"
|
|
|
|
ln -s "$PWD" "$CORE_DIR"
|
|
|
|
|
|
|
|
# setup Homebrew environment
|
2019-02-15 15:07:34 +00:00
|
|
|
export HOMEBREW_NO_AUTO_UPDATE=1
|
|
|
|
export HOMEBREW_NO_ANALYTICS=1
|
|
|
|
export HOMEBREW_FORCE_HOMEBREW_ON_LINUX=1
|
|
|
|
export PATH="$(brew --repo)/Library/Homebrew/vendor/portable-ruby/current/bin:$PATH"
|
|
|
|
|
2019-02-21 12:32:23 +00:00
|
|
|
# setup SSH
|
|
|
|
mkdir ~/.ssh
|
|
|
|
chmod 700 ~/.ssh
|
|
|
|
echo "$FORMULAE_DEPLOY_KEY" > ~/.ssh/id_ed25519
|
|
|
|
chmod 600 ~/.ssh/id_ed25519
|
|
|
|
git config --global core.sshCommand "ssh -i ~/.ssh/id_ed25519 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
2019-02-15 15:07:34 +00:00
|
|
|
|
2019-02-21 12:32:23 +00:00
|
|
|
# clone formulae.brew.sh with SSH so we can push back
|
|
|
|
git clone git@github.com:Homebrew/formulae.brew.sh
|
2019-02-15 13:40:41 +00:00
|
|
|
cd formulae.brew.sh
|
2019-02-15 15:07:34 +00:00
|
|
|
|
2019-02-21 12:32:23 +00:00
|
|
|
# setup analytics
|
|
|
|
echo "$ANALYTICS_JSON_KEY" > ~/.homebrew_analytics.json
|
|
|
|
unset HOMEBREW_NO_ANALYTICS
|
|
|
|
|
2019-02-15 15:07:34 +00:00
|
|
|
# run rake (without a rake binary)
|
|
|
|
ruby -e "load Gem.bin_path('rake', 'rake')"
|
2019-02-21 12:32:23 +00:00
|
|
|
|
|
|
|
# commit and push generated files
|
2019-03-06 17:31:07 +00:00
|
|
|
git commit -m 'formula: update from Homebrew/core push' _data/formula api/formula formula
|
2019-02-21 12:32:23 +00:00
|
|
|
git push
|