Set last build number, updating via composer

This commit is contained in:
Samuel Georges 2017-07-14 22:01:11 +10:00
parent f6eade56af
commit 78d722adf0
3 changed files with 35 additions and 0 deletions

View File

@ -49,6 +49,9 @@
"scripts": {
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-update-cmd": [
"php artisan october:util set build"
]
},
"config": {

View File

@ -357,6 +357,22 @@ class UpdateManager
return $this;
}
/**
* Asks the gateway for the lastest build number and stores it.
* @return void
*/
public function setBuildNumberManually()
{
$result = $this->requestServerData('ping');
$build = (int) array_get($result, 'pong', 420);
Parameter::set([
'system::core.build' => $build
]);
return $build;
}
//
// Modules
//

View File

@ -6,6 +6,7 @@ use Config;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use System\Classes\UpdateManager;
use System\Classes\CombineAssets;
/**
@ -109,6 +110,21 @@ class OctoberUtil extends Command
// Utilties
//
protected function utilSetBuild()
{
$build = UpdateManager::instance()->setBuildNumberManually();
$this->comment('-');
$this->comment('*** October sets build: '.$build);
$this->comment('-');
sleep(1);
$this->comment('Ping? Pong!');
$this->comment('-');
sleep(1);
$this->comment('Ping? Pong!');
$this->comment('-');
}
protected function utilCompileJs()
{
$this->utilCompileAssets('js');