DREC is a collection of basic bash scripts that work together to accomplish common development tasks for Drupal 8.x projects. In simple words drec uses shell commands, unix utilities, drush, drupal console, git, docker and other software that all together can install, update, clone etc a Drupal project.
The main problem I wanted to solve with drec is to setup and update a local development environment from scratch for a Drupal distribution on LAMP. So, you should probably use drec locally or on a development environment and not on a production server. I created this for Linux but it could also play well with any unix* system (hope so).
Some of the characteristics of drec is that it can run commands in chain and that it uses a configuration file (.drecfile) where each project can keep useful details about it that drec can (re)use when running.
Here is a list of the current drec commands:
Command | Description |
---|---|
git-clone | Clone a site from a git repo |
create-folder | Create the project folder |
delete-folder | Delete the project folder |
create-vhost | Create a virtualhost for project's domain |
delete-vhost | Create a virtualhost |
install-drupal | Install Drupal using drush |
prepare-install | Prepare a Drupal site for installation (public files, writable settings etc) |
create-docker | Create a docker container |
delete-docker | Delete a docker container |
create-drush | Create a drush alias |
delete-drush | Delete a drush alias |
composer-install | Run composer install on the project folder |
composer-project | Run composer create-project ... on the project folder |
create-db | Create a mysql database |
download-db | Download a mysql database |
delete-db | Delete a mysql database |
askme | Asks user to continue or exit |
init | Create a *.drecfile settings file on the ~/.drec folder |
delete-project | Delete all project files, database, container, drush alias etc |
projects | Show all *.drecfile filenames inside ~/.drec folder |
debug | Show variables on cli |
and here are some usage examples:
// Clone a project and start a docker container with mapping folders drec init,git-clone,create-docker // Clone a project from a git repo, create a virtualhost and create a new configuration file drec init,git-clone,create-vhost // Create a new database, clone from git repo, prepare for Drupal installation and install Drupal drec init,create-db,git-clone,prepare-install,install-drupal // Just debug a configuration file and read its values drec debug /path/to/MYFILE.drecfile drec debug filename/of/.drecfile
Issues, suggestions and your opinion are always welcome.