druidfi / mana
Druid build tools
Installs: 713
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Type:druid-tool
Requires
- php: ^5.6 || ^7.0
- symfony/console: ^2.8 || ^4.1
- symfony/filesystem: ^2.8 || ^4.1
- symfony/yaml: ^2.8 || ^4.1
Requires (Dev)
- doctrine/instantiator: 1.0.5
- phpdocumentor/reflection-docblock: 3.2.2
- phpunit/php-token-stream: 1.4.11
- phpunit/phpunit: ^5.7 || ^4.1
README
Build, artifact and release management for Drupal 7 sites.
This tool builds environment specific Drupal codebase for your Drupal 7 site.
Quick sheet
By requiring this toolset, your project gets following commands exposed:
vendor/bin/mana-build
creates new build for selected environment to a path (e.g. builds/something)vendor/bin/mana-artifact
makes tar artifact of given pathvendor/bin/mana-release
makes release by symlinking: public > builds/target_buildvendor/bin/mana-dev
is alias for building development build and releasing it
See detailed instructions below.
How to use in the project
Require with Composer:
$ composer require druidfi/mana 0.4.1
Add following scripts your project's composer.json file:
"scripts": {
"artifact": [
"mana-artifact"
],
"build-development": [
"mana-dev"
],
"build-production": [
"mana-build production",
"@release"
],
"build-production": [
"mana-build testing",
"@release"
],
"release": [
"mana-release latest"
]
}
If you're project is on Amazee.io, add also this script:
"scripts": {
"post-update-cmd": [
"mana-post-update"
]
}
Or manually copy vendor/druidfi/mana/dist/Makefile
to your project root.
Needed configuration
Put file called release_config.php
to your project's conf
folder for pre and post hooks (e.g. symlinking).
- Get release example config file: release_config.php
Exposed commands in the requiring project
When installed to the project via Composer, the following command are exposed to vendor/bin
folder.
Create a build
$ vendor/bin/mana-build ENV PATH
ENV=development/production/staging/testing Mandatory
PATH=builds/something Optional, defaults to builds/{date}
Create an artifact (wraps build & artifact commands)
$ vendor/bin/mana-artifact
Create a release (aka symlink public to selected build)
$ vendor/bin/mana-release latest
Create a development build and release
$ vendor/bin/mana-dev
Development and testing
You can also run these commands within this repo:
Create a build
$ bin/mana-dev
Output:
- builds > path where builds are stored (except for development)
- public > released build and the path which should be the webroot
Create an artifact
This command creates a tar file from the source specified (public
folder by default).
$ bin/mana-artifact production
Source folder can be changed with 2nd attribute: $ bin/mana-artifact production someotherfolder
Output:
- current.tar.gz > artifact file
Utility commands
composer clean
will remove files and folders created by build-toolcomposer test
runs PHPUnit tests