By default Kalabox can pull apps from and push apps to Pantheon... but this is much more than basic push/pull integration. Kalabox will build out a local Pantheon environment for each app. This means solr
, redis
, ssl
and terminus
all work just like they do on Pantheon. You can also use drush
, wp-cli
, ssl
and toggle php
version. YAY!
This will spin up a Pantheon-on-Kalabox environment, set up relevant tools like terminus
, drush
and wp-cli
and pull down the site and environment that you choose.
cd /dir/i/want/my/app/to/live (usually ~/Desktop/apps)
kbox create pantheon
? Choose a Pantheon account. mike@kalamuna.com
? Which site? kalabox-eight
? Which environment? dev
? What will you call this monster you have created: (kalabox-eight) eight
cd eight
kbox start # Site is available at http(s)://eight.kbox
You can run various Pantheon-helpful tools like terminus.
Global commands that can be run from anywhere
apps Display list of apps.
create
pantheon Creates a Pantheon app.
update Run this after you update your Kalabox code.
version Display the kbox version.
Actions that can be performed on this app
config Display the kbox application's configuration.
containers Display list of application's installed containers.
destroy Completely destroys and removes an app.
pull Pull down new code and optionally data and files.
push Push up new code and optionally data and files.
rebuild Rebuilds your app while maintaining your app data.
restart Stop and then start a running kbox application.
start Start an installed kbox application.
stop Stop a running kbox application.
Commands and tools this app can use
drush Run drush commands.
git Run git commands.
rsync Run rsync commands.
terminus Run terminus commands.
wp Run wp-cli commands.
You can refresh your local code and even your database and files by running kbox pull
from inside of your Pantheon app. This will pull from the environment you specify during kbox create
.
kbox pull -- -h
Options:
-h, --help Display help message. [boolean]
-v, --verbose Use verbose output. [boolean]
--database Import latest database backup. [boolean]
--files Import latest files. [boolean]
You can easily push up code and even your database and files by running kbox push
. This will push to the environment you specified during kbox create
.
kbox push -- -h
Options:
-h, --help Display help message. [boolean]
-v, --verbose Use verbose output. [boolean]
--message Tell us about your change [string]
--database Push local database up. [boolean]
--files Push local files up. [boolean]
You can use https
by just typing in https://myapp.kbox
in your browser. We self-sign the certs so you will need to allow this in your browser.
Apache Solr comes in each local Pantheon environment. You can use it the exact same way as you do on Pantheon. Reference the Pantheon docs for more information.
Just follow the same instructions from Pantheon to get redis to work locally. https://pantheon.io/docs/articles/sites/redis-as-a-caching-backend/
The TL;DR for Drupal 7 here is
- Install the redis module.
- Use this code snippet in settings.php
// All Pantheon Environments.
if (defined('PANTHEON_ENVIRONMENT')) {
// Use Redis for caching.
$conf['redis_client_interface'] = 'PhpRedis';
$conf['cache_backends'][] = 'sites/all/modules/redis/redis.autoload.inc';
$conf['cache_default_class'] = 'Redis_Cache';
$conf['cache_prefix'] = array('default' => 'pantheon-redis');
// Do not use Redis for cache_form (no performance difference).
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
// Use Redis for Drupal locks (semaphore).
$conf['lock_inc'] = 'sites/all/modules/redis/redis.lock.inc';
}
xdebug is set up on your php appserver. Here is an example SublimeText 2 config (similar settings have been tested on Codebug, Eclipse, and other debugging tools). Note that you may need to launch it in the browser the first time using XDEBUG_SESSION_START=1 as a query parameter (ex: http://my-app.kbox/some-page?XDEBUG_SESSION_START=1). If breakpoints aren't working in your debugger, try inserting xdebug_break() in your code.
{
"folders":
[
{
"path": "/local/path/to/my/code"
}
],
"settings":
{
"xdebug":
{
"max_children": 32,
"max_depth": 16,
"pretty_output": true,
"path_mapping":
{
"/code/": "/local/path/to/my/code/"
},
"port": 9000,
"url": "http://mysite.kbox/"
}
}
}
- API docs
- Test coverage reports
- Kalabox CI dash
- Mountain climbing advice
- Boot2Docker
- Syncthing
- Docker
(C) 2015 Kalamuna and friends