civibuild: Development¶
Custom Build Types¶
By default, civibuild
looks for build types in buildkit/app/config/
.
You may define new build types by creating similar folders. For example,
these steps would make personal folder ($HOME/src/extra_site_configs
)
and register a custom build type snazzy
(based on the wp-demo
type).
## Make your custom folder
$ mkdir "$HOME/src/extra_site_configs"
## Copy an example build-type. Edit to taste.
$ cp -r buildkit/app/config/wp-demo "$HOME/src/extra_site_configs/snazzy"
$ vi "$HOME/src/extra_site_configs/snazzy/download.sh"
$ vi "$HOME/src/extra_site_configs/snazzy/install.sh"
## Build the site
$ export CIVIBUILD_PATH="$HOME/src/extra_site_configs:$CIVIBUILD_PATH"
$ civibuild create snazzy
Put CIVIBUILD_PATH
in civibuild.conf
You may set CIVIBUILD_PATH
explicitly. However, it will be easier to use
if you make the change persistent. See: Settings: civibuild.conf
Testing¶
The tests for civibuild
are stored in tests/phpunit
. These are integration tests which create and destroy real builds on the local system. To run them:
- Configure
amp
(as above) - Ensure that a test site is configured (
civibuild create civibild-test --type empty
) - Run
phpunit4
orenv DEBUG=1 OFFLINE=1 phpunit4
- Note that the tests accept some optional environment variables:
DEBUG=1
- Display command output as it runsOFFLINE=1
- Try to avoid unnecessary network traffic
- Note that the tests accept some optional environment variables: