Buildkit is a collection of ~20 tools for developing and testing CiviCRM. These tools are referenced in the CiviCRM developer documentation.
Many of these tools are commonly used by web developers, so you may have already installed a few. Even so, it's generally easier to download the full collection -- installing each individually takes a lot of work.
This is the same collection of tools which manages the test/demo/release infrastructure for civicrm.org.
- Bash (Unix shell)
- Git
- PHP 5.3+ (For MAMP/XAMPP/etc, see Setup Command-Line PHP)
- NodeJS
- Recommended: Apache 2.2+ and MySQL 5.1+ (client and server) (for amp and civibuild)
- Recommended: Ruby/Rake (for hub)
If you have a new installation of Ubuntu 12.04 or 14.04, then you can download
everything -- buildkit and the system requirements (git
, php
, apache
, mysql
, etc) -- with
one command. This command will install buildkit to ~/buildkit
:
curl -Ls https://civicrm.org/get-buildkit.sh | bash -s -- --full --dir ~/buildkit
Note:
- When executing the above command, you should not run as root. However, you should
have
sudo
permissions. - The
--full
option is opinionated; it specifically installsphp
,apache
, andmysql
(rather thanhvm
,nginx
,lighttpd
, orpercona
). If you try to mix--full
with alternative systems, then expect conflicts.
If you already installed the system requirements (git
, php
, etc or equivalents), then you can
download buildkit to ~/buildkit
with these commands:
git clone https://github.com/civicrm/civicrm-buildkit.git ~/buildkit
cd ~/buildkit
./bin/civi-download-tools
If you have previously downloaded buildkit and want to update it, run:
cd ~/buildkit
git pull
./bin/civi-download-tools
It is useful to register buildkit in the PATH
. This enables you to run commands
by entering a name (e.g. civix
) rather than a full path (e.g.
/path/to/buildkit/bin/civix
).
If you want to ensure that these CLI tools are always available, then:
- Determine the location of your shell configuration file. This is usually
~/.bashrc
,~/.bash_profile
, or~/.profile
. - At the end of the file, add
export PATH="/path/to/buildkit/bin:$PATH"
(with proper adjustments to match your local system). - Close and reopen the terminal.
- Enter the command
which civibuild
. This should display a full-path. If nothing appears, then retry the steps.
Alternatively, if you're just getting started, or if you worry about
conflicts between buildkit and your existing tools, then you can
register buildkit in the PATH temporarily. Simply adapt and run the export
command directly in the terminal:
export PATH=/path/to/buildkit/bin:$PATH
You can restore the normal environment by closing the terminal and opening a new one.
Each time you open a new terminal while working on Civi development, you
would need to re-run the export
command.
- CiviCRM
- civix - Generate skeletal code for CiviCRM extensions.
- civistrings - Scan code for translatable strings (*.pot).
- cividist - Generate nightly tarballs from a series of git branches/tags
- Dependency management
- Source code management
- Source code quality
- civilint - Check the syntax of uncommitted files using phpcs, jshint, etc.
- jshint - Check the syntax of Javascript files.
- phpcs - Check the syntax of PHP files.
- coder 2.x (Civi) - Configure phpcs for Civi code style. Derived from coder 2.x. (The Civi coding standard derives from the Drupal coding standard with variations for class/function/variable naming.)
- Site management
- Testing
- civicrm-upgrade-test - Scripts and data files for testing upgrades.
- karma (w/jasmine) - Unit testing for Javascript.
- paratest - Parallelized version of PHPUnit.
- phpunit - Unit testing for PHP (with Selenium and DB add-ons).