cdev helps you configure your repository to run on virtual environments. It provides a consistent approach to configure, start, stop and destroy environments There are also a smattering of site commands for popular frameworks
This will install the phar to the ~/.cdev directory, and create an alias at /usr/local/bin/cdev
curl -s https://garethmidwood.github.io/cdev/install | bash -s
# confirm installation
which cdev
cdev will update itself to the latest version when you run
cdev self-update
PHP 5.6 or higher
Global config is used as default values for project configuration.
cdev global:configure
In order to use cdev on a project you must first configure it:
git clone git@your:repo.git
cd project/dir
cdev configure
cd project/dir
cdev env:start
cd project/dir
cdev env:stop
cd project/dir
cdev env:nuke
# from anywhere
cdev env:cleanup
cd project/dir
cdev env:ssh
cd project/dir
cdev env:db
You can run a series of shell scripts on the server in alphanumerical order each time an environment has started up. Place your scripts inside the cdev root directory under "scripts/".
You can run the scripts manually via cdev env:scripts
# Example script to add a command to the crontab (scripts/0_cron.sh)
command="php /var/www/html/artisan schedule:run >> /dev/null 2>&1"
job="* * * * * $command"
cat <(fgrep -i -v "$command" <(crontab -l)) <(echo "$job") | crontab -
All contributions are welcome, please submit a pull request!
The repository is packaged with a local-build.sh
script that will generate a cdev-local
app for you to test your changes.
git clone git@github.com:garethmidwood/cdev.git cdev && cd cdev
# install dependencies
cd src && composer install && cd -
# You must have box installed. See https://github.com/box-project/box2
# Allow phar files to be created
# file: php.ini
[Phar]
; http://php.net/phar.readonly
phar.readonly = Off
# build a local copy of cdev for testing
# this will build and copy the file to /usr/local/bin/cdev-local
./local-build.sh
# check it worked
which cdev-local
# should output /usr/local/bin/cdev-local