{"id":16362103,"url":"https://github.com/fubarhouse/drubuild","last_synced_at":"2026-02-03T01:41:32.195Z","repository":{"id":53190409,"uuid":"78424556","full_name":"fubarhouse/drubuild","owner":"fubarhouse","description":"Manage Drupal sites via drush, as a gopher.","archived":false,"fork":false,"pushed_at":"2021-04-01T19:13:10.000Z","size":2899,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-30T02:02:40.948Z","etag":null,"topics":["build","ci","command","composer","drupal","drush","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fubarhouse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-09T11:55:26.000Z","updated_at":"2022-09-08T08:49:26.000Z","dependencies_parsed_at":"2022-09-08T20:21:16.654Z","dependency_job_id":null,"html_url":"https://github.com/fubarhouse/drubuild","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/fubarhouse/drubuild","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fubarhouse%2Fdrubuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fubarhouse%2Fdrubuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fubarhouse%2Fdrubuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fubarhouse%2Fdrubuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fubarhouse","download_url":"https://codeload.github.com/fubarhouse/drubuild/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fubarhouse%2Fdrubuild/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262697229,"owners_count":23349889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build","ci","command","composer","drupal","drush","golang"],"created_at":"2024-10-11T02:23:07.547Z","updated_at":"2026-02-03T01:41:27.150Z","avatar_url":"https://github.com/fubarhouse.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg style=\"float:left\" alight=\"left\" height=\"128px\" width=\"100px\" src=\"https://github.com/fubarhouse/ansible-role-golang/raw/master/gopher.png\"\u003e\n\n# Drubuild\n\n[![stability-stable](https://img.shields.io/badge/stability-stable-green.svg?style=for-the-badge)](https://github.com/orangemug/stability-badges)\n[![Go Report Card](https://goreportcard.com/badge/github.com/fubarhouse/drubuild?style=for-the-badge)](https://goreportcard.com/report/github.com/fubarhouse/drubuild)\n[![License](https://img.shields.io/github/license/mashape/apistatus.svg?style=for-the-badge)](https://raw.githubusercontent.com/fubarhouse/brand/master/LICENSE.txt)\n\n## Compatibility notice\n\nUntil the tooling for Drush 9 becomes stable, this tool will work exclusively with Drush 7 and 8, but not 9.\n\nDrush 9 changes the alias requirements (template) and the commands available including syntax.\n\nAfter Drush 9 is stable and mature, an effort will be made towards compatibility exclusively to Drush 9.\n\nWe will also audit and review a few things at the same time, and inventorize the use of each program (drush, drupal-console, drush-launcher, composer).\n\n## Purpose\n\nDrubuild is a command-line application which builds and manages sites via some common composer and drush commands.\n\nThis application was born of the personal desire of the creator to be a useful tool for CI and automation to be used at work, however the stability and reliability was a catalyst for a lot of work here. \n\nThis application is fully-intended to work out of the box with [DrupalVM](https://www.drupalvm.com/), and a [fork of DrupalVM](https://github.com/fubarhouse/drupal-vm) with the configuration of the maintainer's Ansible role [fubarhouse.golang](https://github.com/fubarhouse/ansible-role-golang) is available for quick opportunities to use this in an isolated environment.\n\nThe application has previously been used for CI tooling for the management of more than 40 websites simultaneously, supporting developers during their local build and development cycle with Jenkins. \n\n## Install\n\nIt is *highly* recommended to install this using Go, and currently no other options are available. \n\n```console\n$ go get -u github.com/fubarhouse/drubuild\n```\n\nAfter installing via `go get`, or with [the configured fork of DrupalVM](https://github.com/fubarhouse/drupal-vm), you should focus your attention on getting Drush Aliases and SSH working.\n\n## Configuration\n\nThere are a couple of steps to configuring Drubuild.\n\n  1. Run `drubuild init --global` to establish a new set of templates and config files with default settings.\n  2. Modify `config.yml` and all templates as required.\n  3. If you are executing Drubuild from teh destination folder without the destination flag, you *can* run `drubuild init` to copy the global config and templates or to setup brand new config or templates (from default values)\n  4. When you first start the build process, please ensure the docroot flag is specified *correctly*.\n\n## Usage\n\nBefore you can begin, you will need to run `drubuild init` to establish a set of templates and configuration settings at `$HOME/drubuild/`.\n\nAfter having made the templates and config available, you can run `drubuild` like any other console application.\n\n```\nUsing config file: /Users/karl/drubuild/config.yml\nA Drupal build system.\n\nUsage:\n  drubuild [command]\n\nAvailable Commands:\n  backup      Take a archive-dump snapshot of a local site\n  build       The build process for Drubuild\n  destroy     Remove all traces of an installed site.\n  help        Help about any command\n  init        Initialise a set of templates in the provided destination path\n  project     Install or remove a project.\n  runner      Runs a series of drush commands consecutively.\n  sync        Execute drush sql-sync or rsync between two drush aliases\n  user        User management tasks\n\nFlags:\n  -h, --help   help for drubuild\n\nUse \"drubuild [command] --help\" for more information about a command.\n```\n\n### Backup\n\nA very simple terminal interface which allows for `drush archive-dump`.\n```\ndrubuild backup --source @mysite.dev --destination /mysite.dev.tar.gz\n```\n\n### Build\n\nThe actual build process, which uses a composer.json file, and some other basic information and build you a site, including installation, multi-site setup, drush alias and virtualhost - all provided by the templates used by the system.\n\nThere are many options here to control the process for site builds, folder hierarchy (specify a docroot in the folder) etc.\n```\ndrubuild build --name mysite --domain mysite.dev --destination /sites/mysite.dev --composer /composer.json --vhost --install\n```\n\n### Destroy\n\nThe reverse of building, to remove all traces of a previously built site, including file system, databases, aliases, virtual hosts etc.\n```\ndrubuild destroy --name mysite --domain mysite.dev --destination /sites/mysite.dev\n```\n\n### Help\n\nBasically provide the help text listed above.\n```\ndrubuild --help\n```\n\n### Init\n\nInitialise or replace configurables and templates with defaults.\n```\ndrubuild init\n```\n\n### Project\n\nAdd or remove a project to a built site using information available in the composer.json file.\n```\ndrubuild project --name drupal/core --path /sites/mysite.dev --remove --add --version ^8\n```\n\n### Runner\n\nThe drush command runner is a scalable task runner which will execute a comma-separated list of drush commands on a comma-separated list of drush aliases with pattern matching supported for scaling.\n```\ndrubuild runner --aliases dev,test,preprod,prod --pattern mysite.%v --commands \"updb -y,cache-rebuild\"\n```\n\n### Sync\n\nThe syncer will attempt to sync the databases and files between two Drush aliases. Note that this can be very dangerous if used incorrectly, and Drush doesn't support remote to remote syncs. The exact settings for this can be found in the Drush alias template.\n```\ndrubuild sync --source mysite.prod --destination mysite.local  --database --files --yes\n```\n\n### User\n\nThe user command will act much like the runner, which can create, block, unblock, delete, reset password, add roles, and general maintenance accross a set of sites using alias pattern matching.\n\nThis one has proven critical when managing literally hundreds of Drupal accounts.\n```\ndrubuild user --name TestUser --email test@user.com --password MyPassword --aliases dev,test,preprod,prod --pattern mysite.%v --create\n```\n\n## Example\n\nUsing our [fork](https://github.com/fubarhouse/drupal-vm) of DrupalVM, here's a full example of how a site could be stood up from the default setup.\n\n\u003cspan style=\"color:red\"\u003eDo not forget to apply the --docroot flag!\u003c/span\u003e\n\nThe docroot using the example composer.json file supplied with DrupalVM is \"web\".\n\nIt should also be noted that there is a bug with using dashes in the name flag, please avoid it. \n\n````\nvagrant@drupalvm2:~$ mkdir -p /vagrant/sites/mysiteone\nvagrant@drupalvm2:~$ cp /vagrant/example.drupal.composer.json /vagrant/sites/mysiteone/composer.json\nvagrant@drupalvm2:~$ cd /vagrant/sites/mysiteone/\nvagrant@drupalvm2:/vagrant/sites/mysiteone$ drubuild init\nUsing config file: /home/vagrant/drubuild/config.yml\n2017/11/24 08:11:20 Templating /vagrant/sites/mysiteone/drubuild/config.yml from defaults.\n2017/11/24 08:11:20 Replacing /vagrant/sites/mysiteone/drubuild/sites.php.tmpl with /home/vagrant/drubuild/sites.php.tmpl.\n2017/11/24 08:11:20 Replacing /vagrant/sites/mysiteone/drubuild/alias.tmpl with /home/vagrant/drubuild/alias.tmpl.\n2017/11/24 08:11:20 Replacing /vagrant/sites/mysiteone/drubuild/vhost.tmpl with /home/vagrant/drubuild/vhost.tmpl.\nvagrant@drupalvm2:/vagrant/sites/mysiteone$ drubuild build --name mysiteone --domain mysiteone.test --docroot web --vhost --install\nUsing config file: /vagrant/sites/mysiteone/drubuild/config.yml\nINFO[0000] Timestamp not specified, using 20171124081132\nINFO[0000] composer.json not found, copying from /vagrant/sites/mysiteone/composer.json\nINFO[0000] Copied /vagrant/sites/mysiteone/composer.json to /vagrant/sites/mysiteone/mysiteone.20171124081132_7047/composer.json\n\n    1/1:\thttps://packages.drupal.org/8/drupal/provider-2017-3$6850a9263c4bed0fd003e1e84e14c71f4aa9b8304a453f7754d6c1edbd25c638.json\n    Finished: success: 1, skipped: 0, failure: 0, total: 1\n    1/3:\thttp://packagist.org/p/provider-latest$40d2eeb0a214664f06b7959191e50bfd93e2b6b3adb023ebc5f18e8f95fb7134.json\n    2/3:\thttp://packagist.org/p/provider-2017-10$3706041cdaaf6c9ce37bc29a6f8460c5b6e26806ed76eed4f4e182baece607a1.json\n    3/3:\thttp://packagist.org/p/provider-2017-07$ffb45f4bf7108849406afd662d60ef80cffec40a957318122b362f8b1b99c9d1.json\n    Finished: success: 3, skipped: 0, failure: 0, total: 3\nLoading composer repositories with package information\nUpdating dependencies (including require-dev)\nPackage operations: 44 installs, 0 updates, 0 removals\n  - Installing composer/installers (v1.4.0): Loading from cache\n  - Installing drupal-composer/drupal-scaffold (2.3.0): Loading from cache\n  - Installing zendframework/zend-stdlib (3.1.0): Loading from cache\n  - Installing zendframework/zend-escaper (2.5.2): Loading from cache\n  - Installing zendframework/zend-feed (2.8.0): Loading from cache\n  - Installing psr/http-message (1.0.1): Loading from cache\n  - Installing zendframework/zend-diactoros (1.6.1): Loading from cache\n  - Installing twig/twig (v1.35.0): Loading from cache\n  - Installing symfony/yaml (v3.2.14): Loading from cache\n  - Installing symfony/polyfill-mbstring (v1.6.0): Loading from cache\n  - Installing symfony/translation (v3.2.14): Loading from cache\n  - Installing symfony/validator (v3.2.14): Loading from cache\n  - Installing symfony/serializer (v3.2.14): Loading from cache\n  - Installing symfony/routing (v3.2.14): Loading from cache\n  - Installing paragonie/random_compat (v2.0.11): Loading from cache\n  - Installing symfony/http-foundation (v3.2.14): Loading from cache\n  - Installing symfony/psr-http-message-bridge (v1.0.0): Loading from cache\n  - Installing symfony/process (v3.2.14): Loading from cache\n  - Installing symfony/polyfill-iconv (v1.6.0): Loading from cache\n  - Installing symfony/event-dispatcher (v3.2.14): Loading from cache\n  - Installing psr/log (1.0.2): Loading from cache\n  - Installing symfony/debug (v3.3.13): Loading from cache\n  - Installing symfony/http-kernel (v3.2.14): Loading from cache\n  - Installing symfony/dependency-injection (v3.2.14): Loading from cache\n  - Installing symfony/console (v3.2.14): Loading from cache\n  - Installing symfony/class-loader (v3.2.14): Loading from cache\n  - Installing symfony-cmf/routing (1.4.1): Loading from cache\n  - Installing stack/builder (v1.0.5): Loading from cache\n  - Installing masterminds/html5 (2.3.0): Loading from cache\n  - Installing guzzlehttp/psr7 (1.4.2): Loading from cache\n  - Installing guzzlehttp/promises (v1.3.1): Loading from cache\n  - Installing guzzlehttp/guzzle (6.3.0): Loading from cache\n  - Installing doctrine/lexer (v1.0.1): Loading from cache\n  - Installing egulias/email-validator (1.2.14): Loading from cache\n  - Installing easyrdf/easyrdf (0.9.1): Loading from cache\n  - Installing doctrine/inflector (v1.2.0): Loading from cache\n  - Installing doctrine/collections (v1.5.0): Loading from cache\n  - Installing doctrine/cache (v1.7.1): Loading from cache\n  - Installing doctrine/annotations (v1.5.0): Loading from cache\n  - Installing doctrine/common (v2.8.1): Loading from cache\n  - Installing composer/semver (1.4.2): Loading from cache\n  - Installing asm89/stack-cors (1.1.0): Loading from cache\n  - Installing drupal/core (8.4.2): Loading from cache\n  - Installing drupal/devel (dev-1.x be072e7): Cloning be072e747c from cache\nzendframework/zend-feed suggests installing zendframework/zend-cache (Zend\\Cache component, for optionally caching feeds between requests)\nzendframework/zend-feed suggests installing zendframework/zend-db (Zend\\Db component, for use with PubSubHubbub)\nzendframework/zend-feed suggests installing zendframework/zend-http (Zend\\Http for PubSubHubbub, and optionally for use with Zend\\Feed\\Reader)\nzendframework/zend-feed suggests installing zendframework/zend-servicemanager (Zend\\ServiceManager component, for easily extending ExtensionManager implementations)\nzendframework/zend-feed suggests installing zendframework/zend-validator (Zend\\Validator component, for validating email addresses used in Atom feeds and entries ehen using the Writer subcomponent)\nsymfony/translation suggests installing symfony/config ()\nsymfony/validator suggests installing psr/cache-implementation (For using the metadata cache.)\nsymfony/validator suggests installing symfony/config ()\nsymfony/validator suggests installing symfony/expression-language (For using the Expression validator)\nsymfony/validator suggests installing symfony/intl ()\nsymfony/serializer suggests installing psr/cache-implementation (For using the metadata cache.)\nsymfony/serializer suggests installing symfony/config (For using the XML mapping loader.)\nsymfony/serializer suggests installing symfony/property-access (For using the ObjectNormalizer.)\nsymfony/serializer suggests installing symfony/property-info (To deserialize relations.)\nsymfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)\nsymfony/routing suggests installing symfony/expression-language (For using expression matching)\nparagonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)\nsymfony/http-kernel suggests installing symfony/browser-kit ()\nsymfony/http-kernel suggests installing symfony/config ()\nsymfony/http-kernel suggests installing symfony/finder ()\nsymfony/http-kernel suggests installing symfony/var-dumper ()\nsymfony/dependency-injection suggests installing symfony/config ()\nsymfony/dependency-injection suggests installing symfony/expression-language (For using expressions in service container configuration)\nsymfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)\nsymfony/console suggests installing symfony/filesystem ()\nsymfony/class-loader suggests installing symfony/polyfill-apcu (For using ApcClassLoader on HHVM)\neasyrdf/easyrdf suggests installing ml/json-ld (~1.0)\ndoctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver)\ndrupal/devel suggests installing symfony/var-dumper (Pretty print complex values better with var-dumper available)\nWriting lock file\nGenerating autoload files\nINFO[0089] Found template /vagrant/sites/mysiteone/drubuild/sites.php.tmpl for usage\nINFO[0089] Created directory /vagrant/sites/mysiteone/mysiteone.20171124081132_7047/web/sites/mysiteone\nINFO[0089] Permissions set to 0755 on /vagrant/sites/mysiteone/mysiteone.20171124081132_7047/web/sites/mysiteone\nINFO[0089] Successfully templated multisite config to file /vagrant/sites/mysiteone/mysiteone.20171124081132_7047/web/sites//sites.php\nINFO[0089] Created symlink\n\n\n\n\nYou are about to create a sites/mysiteone/settings.php file and DROP all tables in your 'mysiteone_20171124081132_7047' database. Do you want to continue? (y/n): y\n\n\n\n\n\n\nStarting Drupal installation. This takes a while. Consider using the [ok]\n--notify global option.\n\n\n\nInstallation complete.  User name: admin  User password: o2pJvkvfoM  [ok]\nCongratulations, you installed Drupal!                               [status]\nINFO[0119] Found template /vagrant/sites/mysiteone/drubuild/vhost.tmpl for usage\nINFO[0119] Successfully templated /vagrant/sites/mysiteone/drubuild/vhost.tmpl to file /etc/nginx/sites-enabled//mysiteone.test.conf\nINFO[0119] Found template /vagrant/sites/mysiteone/drubuild/alias.tmpl for usage\nINFO[0119] Successfully templated alias to file /home/vagrant/.drush/mysiteone.test.alias.drushrc.php\nINFO[0119] Based upon the output above, you may need to restart the web service.\nvagrant@drupalvm2:/vagrant/sites/mysiteone$ sudo service nginx restart\nvagrant@drupalvm2:/vagrant/sites/mysiteone$ curl http://mysiteone.test/ | grep drupal\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\u003cmeta name=\"Generator\" content=\"Drupal 8 (https://www.drupal.org)\" /\u003e\n        \u003ca href=\"/user/login\" data-drupal-link-system-path=\"user/login\"\u003eLog in\u003c/a\u003e\n100  8518    0  8518    0     0   225k      0 --:--:-- --:--:-- --:--:--  231k\n        \u003ca href=\"/\" data-drupal-link-system-path=\"\u0026lt;front\u0026gt;\" class=\"is-active\"\u003eHome\u003c/a\u003e\n    \u003cdiv class=\"search-block-form block block-search container-inline\" data-drupal-selector=\"search-block-form\" id=\"block-bartik-search\" role=\"search\"\u003e\n        \u003cinput title=\"Enter the terms you wish to search for.\" data-drupal-selector=\"edit-keys\" type=\"search\" id=\"edit-keys\" name=\"keys\" value=\"\" size=\"15\" maxlength=\"128\" class=\"form-search\" /\u003e\n\u003cdiv data-drupal-selector=\"edit-actions\" class=\"form-actions js-form-wrapper form-wrapper\" id=\"edit-actions\"\u003e\u003cinput class=\"search-form__submit button js-form-submit form-submit\" data-drupal-selector=\"edit-submit\" type=\"submit\" id=\"edit-submit\" value=\"Search\" /\u003e\n        \u003ca href=\"/contact\" data-drupal-link-system-path=\"contact\"\u003eContact\u003c/a\u003e\n      \u003cspan\u003ePowered by \u003ca href=\"https://www.drupal.org\"\u003eDrupal\u003c/a\u003e\u003c/span\u003e\n````\n\nFrom here, you simply need to add a hosts entry for the domain, and a drush alias if accessing the site via drush from the host machine.\n\n## Author Information\n\nThis product was originally created in 2016 by [Karl Hepworth](https://twitter.com/fubarhouse).\n\nImage of Go's mascot was created by [Takuya Ueda](https://twitter.com/tenntenn). Licenced under the Creative Commons 3.0 Attributions license. This image has been resized for purpose, but is otherwise unchanged.\n\n## License\n\nMIT - Free to use and manipulate with no guaranteed support by the creator.\n\nObviously we want to make the best product available so PR's, bug reports and feature requests are welcome! ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffubarhouse%2Fdrubuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffubarhouse%2Fdrubuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffubarhouse%2Fdrubuild/lists"}