Remove pluginconfig + added application parameter 'php-censor.build.remove_builds' for control artifacts
This commit is contained in:
parent
d07e98178e
commit
cad14a7377
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,6 +2,5 @@
|
||||||
/composer.phar
|
/composer.phar
|
||||||
/runtime
|
/runtime
|
||||||
/app/loggerconfig.php
|
/app/loggerconfig.php
|
||||||
/app/pluginconfig.php
|
|
||||||
/app/config.yml
|
/app/config.yml
|
||||||
/public/assets/vendor
|
/public/assets/vendor
|
||||||
|
|
|
@ -24,4 +24,6 @@ php-censor:
|
||||||
pull_request: false
|
pull_request: false
|
||||||
authentication_settings:
|
authentication_settings:
|
||||||
state: false
|
state: false
|
||||||
user_id: 1
|
user_id: 1
|
||||||
|
build:
|
||||||
|
remove_builds: true
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
return function (PHPCensor\Plugin\Util\Factory $factory) {
|
|
||||||
$factory->registerResource(
|
|
||||||
// This function will be called when the resource is needed.
|
|
||||||
function() {
|
|
||||||
return [
|
|
||||||
'Foo' => "Stuff",
|
|
||||||
'Bar' => "More Stuff"
|
|
||||||
];
|
|
||||||
},
|
|
||||||
|
|
||||||
// In addition to the function for building the resource the system
|
|
||||||
// also needs to be told when to load the resource. Either or both
|
|
||||||
// of the following arguments can be used (null to ignore)
|
|
||||||
|
|
||||||
// This resource will only be given when the argument name is:
|
|
||||||
"ResourceArray",
|
|
||||||
|
|
||||||
// The resource will only be given when the type hint is:
|
|
||||||
PHPCensor\Plugin\Util\Factory::TYPE_ARRAY
|
|
||||||
);
|
|
||||||
};
|
|
|
@ -109,10 +109,8 @@ class Builder implements LoggerAwareInterface
|
||||||
$this->build = $build;
|
$this->build = $build;
|
||||||
$this->store = Factory::getStore('Build', 'PHPCensor');
|
$this->store = Factory::getStore('Build', 'PHPCensor');
|
||||||
|
|
||||||
$this->buildLogger = new BuildLogger($logger, $build);
|
$this->buildLogger = new BuildLogger($logger, $build);
|
||||||
|
$pluginFactory = $this->buildPluginFactory($build);
|
||||||
$pluginFactory = $this->buildPluginFactory($build);
|
|
||||||
$pluginFactory->addConfigFromFile(APP_DIR . "pluginconfig.php");
|
|
||||||
$this->pluginExecutor = new Plugin\Util\Executor($pluginFactory, $this->buildLogger);
|
$this->pluginExecutor = new Plugin\Util\Executor($pluginFactory, $this->buildLogger);
|
||||||
|
|
||||||
$executorClass = 'PHPCensor\Helper\UnixCommandExecutor';
|
$executorClass = 'PHPCensor\Helper\UnixCommandExecutor';
|
||||||
|
@ -251,9 +249,12 @@ class Builder implements LoggerAwareInterface
|
||||||
$this->build->sendStatusPostback();
|
$this->build->sendStatusPostback();
|
||||||
$this->build->setFinished(new \DateTime());
|
$this->build->setFinished(new \DateTime());
|
||||||
|
|
||||||
// Clean up:
|
$removeBuilds = (bool)Config::getInstance()->get('php-censor.build.remove_builds', true);
|
||||||
$this->buildLogger->log("\n" . Lang::get('removing_build'));
|
if ($removeBuilds) {
|
||||||
$this->build->removeBuildDirectory();
|
// Clean up:
|
||||||
|
$this->buildLogger->log("\n" . Lang::get('removing_build'));
|
||||||
|
$this->build->removeBuildDirectory();
|
||||||
|
}
|
||||||
|
|
||||||
$this->store->save($this->build);
|
$this->store->save($this->build);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue