- Notifications
You must be signed in to change notification settings - Fork0
A build automation tool for MacPorts’ Buildbot setup
ryandesign/mpbb
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a collection of scripts that will be run by the MacPortsProject's Buildbot buildslaves for continuous integration andprecompilation of binary archives.
Thempbb
("MacPorts Buildbot") driver script defines a subcommand foreach step of a build. These subcommands are implemented as separatescripts namedmpbb-SUBCOMMAND
, but they are not intended to bestandalone programs and should not be executed as such. Build stepsshould only be run using thempbb
driver.
The defined build steps are:
Update base without updating the portindex.
mpbb --prefix /opt/local selfupdate
Checkout ports tree and update the portindex.
mpbb --prefix /opt/local --work-dir /tmp/scratch \ checkout \ [--ports-url https://github.com/macports/macports-ports.git] \ [--ports-commit 40c3ce0a26abc0d778754ecde9660bead94a2ffd]
Print one or more ports' subports to standard output.
mpbb --prefix /opt/local list-subports php cmake llvm-3.8 [...]
For each subport listed in step 3:
a. Install dependencies.
mpbb --prefix /opt/local install-dependencies php71
b. Install the subport itself.
mpbb --prefix /opt/local install-port php71
c. Gather archives.
mpbb --prefix /opt/local --work-dir /tmp/scratch \ gather-archives \ --archive-site https://packages.macports.org \ --staging-dir /tmp/scratch/staging
d. Upload. Must be implemented in the buildmaster.
e. Deploy. Must be implemented in the buildmaster.
f. Clean up. This must always be run, even if a previous stepfailed.
mpbb --prefix /opt/local cleanup
Subcommand scripts are sourced by thempbb
driver. A script namedmpbb-SUBCOMMAND
must define these two shell functions:
SUBCOMMAND()
:Perform the subcommand's work and return zero on success andnonzero on failure.SUBCOMMAND-usage()
:Print to standard out a usage summary, a description of thesubcommand's purpose, and the subcommand's options, but do notexit
. The output is passed throughfmt(1)
, so single newlinesare not preserved.
Scripts may define additional functions as desired. For example, thempbb-list-subports
script defines the requiredlist-subports
andlist-subports-usage
functions, as well as aprint-subports
helper.
Subcommand scripts may use but not modify these global shell parameters:
$command
:The name of the subcommand.$option_prefix
:The prefix of the MacPorts installation.$option_jobs_dir
:The path to a local copy of thejobs tools.$option_log_dir
:A directory for storing build logs.$option_work_dir
:A directory for storing temporary data. It is guaranteed topersist for the duration of anmpbb
run, so it may be used toshare ancillary files (e.g., a Subversion checkout of the portstree) between builds of different ports.$option_failcache_dir
:A directory for storing information about previously failed builds whichsaves time because builds that are known to fail will not be attempted.$option_license_db_dir
:A directory for storing information about port licenses used by theport_binary_distributable.tcl script.
mpbb
is written inbash andis known to be compatible with 3.2.17 through 3.2.57.- Library functions
compute_failcache_hash
requires anOpenSSL that can generate SHA256 digests.parseopt
requiresFrodo Looijaard's enhancedgetopt(1)
,which is available from thegetopt
port.
- Subcommands
- Any subcommand involving ports requires MacPorts, obviously.
mpbb checkout
requires one or both of theGit andSubversion clients.mpbb help
requiresfmt(1)
.mpbb gather-archives
requirescurl.mpbb selfupdate
requires Make.
For development ofmpbb
, we recommend the following setup:
- Install a separate copy of MacPorts, e.g. in
/opt/mports
. SeeInstall Multiple MacPorts Copies.It is not recommended to use your normal copy of MacPorts, sincempbb
willdo cleanup after installation and deactivate all active ports. - Call
mpbb
with--prefix=/opt/mports
to use your custom prefix. You mayalso want to set--work-dir
.