HomePhabricator

Add a script for building and pushing automated commits

Description

Add a script for building and pushing automated commits

Summary:
This script provides a similar function to contrib/teamcity/build-configurations.sh and allows us to define various
pipelines that a bot can and is expected to run, given some trigger (such as a schedule). This initial version of the script
supports update-chainparams only for now, but others will soon be added.

To prep for this script's deployment, I've done the following:

  • Setup a machine to run bitcoind instances on mainnet and testnet where this script can be run.
  • Created a bot user 'abc-bot' on Phabricator.
  • Added Herald rules to allow abc-bot to push changes upstream without code review.

The script will be scheduled in Teamcity to run update-chainparams once per week.

Test Plan:

git ch -b testbranch  # we assume we're not writing changes directly on master
./automated-commits.sh  # errors as expected

bitcoind &
PID1=$!
bitcoind --testnet &
PID2=$!
DIFF_NAME=update-chainparams ./automated-commits.sh  # succeeds, but as a dry-run

sudo kill $PID2
git ch testbranch
DIFF_NAME=update-chainparams ./automated-commits.sh  # fails, leaving uncommitted changes

git stash
git ch testbranch
git stash pop         # test with dirty source tree
bitcoind --testnet &
PID2=$!
DIFF_NAME=update-chainparams ./automated-commits.sh  # succeeds, but as a dry-run
sudo kill $PID1 $PID2

Reviewers: #bitcoin_abc, deadalnix, Fabien

Reviewed By: #bitcoin_abc, deadalnix, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D5045