forked from MichaelYick/mailpoet
Add ./do container:dump command and run it within build
[MAILPOET-1605]
This commit is contained in:
parent
f39c0c58c2
commit
9eb586b8e6
@ -25,3 +25,4 @@ WP_TEST_MAILER_SMTP_PASSWORD=""
|
||||
WP_SVN_USERNAME=""
|
||||
WP_SVN_PASSWORD=""
|
||||
WP_TRANSIFEX_API_TOKEN=""
|
||||
WP_ROOT = ""
|
||||
|
@ -94,6 +94,8 @@ $ ./do delete:docker # stop and remove all running docker containers.
|
||||
$ ./do qa:lint # PHP code linter.
|
||||
$ ./do qa:lint:javascript # JS code linter.
|
||||
$ ./do qa # PHP and JS linters.
|
||||
|
||||
$ ./do container:dump # Dumps DI container.
|
||||
```
|
||||
|
||||
# Coding and Testing
|
||||
|
15
RoboFile.php
15
RoboFile.php
@ -282,6 +282,21 @@ class RoboFile extends \Robo\Tasks {
|
||||
return $this->_exec('vendor/bin/codecept run integration -g failed');
|
||||
}
|
||||
|
||||
function containerDump() {
|
||||
$this->say('Deleting DI Container');
|
||||
$this->_exec('rm -f ./lib/DI/CachedContainer.php');
|
||||
$this->say('Generating DI container cache');
|
||||
$this->loadEnv();
|
||||
define('ABSPATH', getenv('WP_ROOT') . '/');
|
||||
if (!file_exists(ABSPATH . 'wp-config.php')) {
|
||||
$this->yell('WP_ROOT env variable does not contain valid path to wordpress root.', 40, 'red');
|
||||
exit(1);
|
||||
}
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
$container_factory = new \MailPoet\DI\ContainerFactory();
|
||||
$container_factory->dumpContainer();
|
||||
}
|
||||
|
||||
function qa() {
|
||||
$collection = $this->collectionBuilder();
|
||||
$collection->addCode(array($this, 'qaLint'));
|
||||
|
5
build.sh
5
build.sh
@ -22,6 +22,11 @@ test -d node_modules && rm -rf node_modules
|
||||
npm install
|
||||
./do compile:all --env production
|
||||
|
||||
# Dependency injection container cache.
|
||||
echo '[BUILD] Building DI Container cache'
|
||||
./composer.phar install
|
||||
./do container:dump
|
||||
|
||||
# Production libraries.
|
||||
echo '[BUILD] Fetching production libraries'
|
||||
test -d vendor && rm -rf vendor
|
||||
|
Loading…
x
Reference in New Issue
Block a user