More installer fixes, creation and seeding works
This commit is contained in:
2
Makefile
2
Makefile
@@ -40,7 +40,7 @@ install: build
|
|||||||
update: build
|
update: build
|
||||||
@php composer.phar dump-autoload
|
@php composer.phar dump-autoload
|
||||||
@php composer.phar update --no-interaction
|
@php composer.phar update --no-interaction
|
||||||
@php artisan migrate
|
@php artisan migrate --force
|
||||||
@echo "Done!"
|
@echo "Done!"
|
||||||
|
|
||||||
.PHONY: reset
|
.PHONY: reset
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ class DatabaseSeeder extends Seeder
|
|||||||
}
|
}
|
||||||
|
|
||||||
$path = database_path('seeds/'.$env.'.yml');
|
$path = database_path('seeds/'.$env.'.yml');
|
||||||
print("Seeding seeds/$env.yml\n");
|
|
||||||
|
|
||||||
if(!file_exists($path)) {
|
if(!file_exists($path)) {
|
||||||
$path = database_path('seeds/prod.yml');
|
$path = database_path('seeds/prod.yml');
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
|
use Log;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Database\QueryException;
|
||||||
use Webpatser\Uuid\Uuid;
|
use Webpatser\Uuid\Uuid;
|
||||||
use Symfony\Component\Yaml\Yaml;
|
use Symfony\Component\Yaml\Yaml;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
@@ -58,7 +60,11 @@ class DatabaseService extends BaseService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DB::table($table)->insert($row);
|
try {
|
||||||
|
DB::table($table)->insert($row);
|
||||||
|
} catch(QueryException $e) {
|
||||||
|
Log::info($e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,9 +117,13 @@ class InstallerController extends AppBaseController
|
|||||||
);
|
);
|
||||||
|
|
||||||
$log[] = 'Creating database';
|
$log[] = 'Creating database';
|
||||||
$this->dbService->setupDB();
|
$console_out = $this->dbService->setupDB();
|
||||||
|
|
||||||
return redirect('/');
|
return view('installer::steps/step2a-completed', [
|
||||||
|
'console_output' => $console_out
|
||||||
|
]);
|
||||||
|
|
||||||
|
//return redirect('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -129,4 +133,9 @@ class InstallerController extends AppBaseController
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function complete(Request $request)
|
||||||
|
{
|
||||||
|
return redirect('/');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,3 +8,5 @@ Route::get('/step3', 'InstallerController@step3')->name('step3');
|
|||||||
|
|
||||||
Route::post('/dbtest', 'InstallerController@dbtest')->name('dbtest');
|
Route::post('/dbtest', 'InstallerController@dbtest')->name('dbtest');
|
||||||
Route::post('/dbsetup', 'InstallerController@dbsetup')->name('dbsetup');
|
Route::post('/dbsetup', 'InstallerController@dbsetup')->name('dbsetup');
|
||||||
|
|
||||||
|
Route::get('/complete', 'InstallerController@complete')->name('complete');
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<link href="/vendor/select2/dist/css/select2.min.css" rel="stylesheet"/>
|
<link href="/vendor/select2/dist/css/select2.min.css" rel="stylesheet"/>
|
||||||
<link href="/assets/frontend/css/now-ui-kit.css" rel="stylesheet"/>
|
<link href="/assets/frontend/css/now-ui-kit.css" rel="stylesheet"/>
|
||||||
<link href="/assets/frontend/css/styles.css" rel="stylesheet"/>
|
<link href="/assets/frontend/css/styles.css" rel="stylesheet"/>
|
||||||
|
<link href="/assets/frontend/css/installer.css" rel="stylesheet"/>
|
||||||
@yield('css')
|
@yield('css')
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -59,6 +60,8 @@
|
|||||||
<div class="clearfix" style="height: 200px;"></div>
|
<div class="clearfix" style="height: 200px;"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
|
||||||
|
|
||||||
<script src="/assets/frontend/js/core/jquery.3.2.1.min.js" type="text/javascript"></script>
|
<script src="/assets/frontend/js/core/jquery.3.2.1.min.js" type="text/javascript"></script>
|
||||||
<script src="/assets/frontend/js/core/tether.min.js" type="text/javascript"></script>
|
<script src="/assets/frontend/js/core/tether.min.js" type="text/javascript"></script>
|
||||||
<script src="/assets/frontend/js/core/bootstrap.min.js" type="text/javascript"></script>
|
<script src="/assets/frontend/js/core/bootstrap.min.js" type="text/javascript"></script>
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
@extends('installer::app')
|
||||||
|
@section('title', 'Database Setup')
|
||||||
|
@section('content')
|
||||||
|
<div style="align-content: center;">
|
||||||
|
{!! Form::open(['route' => 'installer.complete', 'method' => 'GET']) !!}
|
||||||
|
|
||||||
|
<pre class="prettyprint lang-html">
|
||||||
|
<code class="language-bash">
|
||||||
|
{!! $console_output !!}
|
||||||
|
</code>
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<p style="text-align: right">
|
||||||
|
{!! Form::submit('Complete Setup >>', ['class' => 'btn btn-success']) !!}
|
||||||
|
</p>
|
||||||
|
{!! Form::close() !!}
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@@ -44,7 +44,16 @@ class DatabaseService {
|
|||||||
*/
|
*/
|
||||||
public function setupDB()
|
public function setupDB()
|
||||||
{
|
{
|
||||||
\Artisan::call('database:create');
|
$output = "";
|
||||||
\Artisan::call('migrate:refresh');
|
#\Artisan::call('database:create');
|
||||||
|
#$output .= \Artisan::output();
|
||||||
|
|
||||||
|
\Artisan::call('migrate');
|
||||||
|
$output .= \Artisan::output();
|
||||||
|
|
||||||
|
\Artisan::call('db:seed');
|
||||||
|
$output .= \Artisan::output();
|
||||||
|
|
||||||
|
return $output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
135
public/assets/frontend/css/installer.css
Normal file
135
public/assets/frontend/css/installer.css
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
/* desert scheme ported from vim to google prettify */
|
||||||
|
pre.prettyprint {
|
||||||
|
display: block;
|
||||||
|
padding-left: 4px;
|
||||||
|
background-color: #333
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .nocode {
|
||||||
|
background-color: none;
|
||||||
|
color: #000
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .str {
|
||||||
|
color: #ffa0a0
|
||||||
|
}
|
||||||
|
|
||||||
|
/* string - pink */
|
||||||
|
pre .kwd {
|
||||||
|
color: #f0e68c;
|
||||||
|
font-weight: bold
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .com {
|
||||||
|
color: #87ceeb
|
||||||
|
}
|
||||||
|
|
||||||
|
/* comment - skyblue */
|
||||||
|
pre .typ {
|
||||||
|
color: #98fb98
|
||||||
|
}
|
||||||
|
|
||||||
|
/* type - lightgreen */
|
||||||
|
pre .lit {
|
||||||
|
color: #cd5c5c
|
||||||
|
}
|
||||||
|
|
||||||
|
/* literal - darkred */
|
||||||
|
pre .pun {
|
||||||
|
color: #fff
|
||||||
|
}
|
||||||
|
|
||||||
|
/* punctuation */
|
||||||
|
pre .pln {
|
||||||
|
color: #fff
|
||||||
|
}
|
||||||
|
|
||||||
|
/* plaintext */
|
||||||
|
pre .tag {
|
||||||
|
color: #f0e68c;
|
||||||
|
font-weight: bold
|
||||||
|
}
|
||||||
|
|
||||||
|
/* html/xml tag - lightyellow */
|
||||||
|
pre .atn {
|
||||||
|
color: #bdb76b;
|
||||||
|
font-weight: bold
|
||||||
|
}
|
||||||
|
|
||||||
|
/* attribute name - khaki */
|
||||||
|
pre .atv {
|
||||||
|
color: #ffa0a0
|
||||||
|
}
|
||||||
|
|
||||||
|
/* attribute value - pink */
|
||||||
|
pre .dec {
|
||||||
|
color: #98fb98
|
||||||
|
}
|
||||||
|
|
||||||
|
/* decimal - lightgreen */
|
||||||
|
|
||||||
|
/* Specify class=linenums on a pre to get line numbering */
|
||||||
|
ol.linenums {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
color: #AEAEAE
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IE indents via margin-left */
|
||||||
|
li.L0, li.L1, li.L2, li.L3, li.L5, li.L6, li.L7, li.L8 {
|
||||||
|
list-style-type: none
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Alternate shading for lines */
|
||||||
|
li.L1, li.L3, li.L5, li.L7, li.L9 {
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
pre.prettyprint {
|
||||||
|
background-color: none
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .str, code .str {
|
||||||
|
color: #060
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .kwd, code .kwd {
|
||||||
|
color: #006;
|
||||||
|
font-weight: bold
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .com, code .com {
|
||||||
|
color: #600;
|
||||||
|
font-style: italic
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .typ, code .typ {
|
||||||
|
color: #404;
|
||||||
|
font-weight: bold
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .lit, code .lit {
|
||||||
|
color: #044
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .pun, code .pun {
|
||||||
|
color: #440
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .pln, code .pln {
|
||||||
|
color: #000
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .tag, code .tag {
|
||||||
|
color: #006;
|
||||||
|
font-weight: bold
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .atn, code .atn {
|
||||||
|
color: #404
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .atv, code .atv {
|
||||||
|
color: #060
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user