Skip to content

Commit

Permalink
Merge pull request #757 from portabilis/fix-installer
Browse files Browse the repository at this point in the history
[2.6] Corrige o instalador em servidor
  • Loading branch information
edersoares authored Mar 17, 2021
2 parents 59ce6fb + 55b8518 commit 6513f47
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 25 deletions.
5 changes: 2 additions & 3 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Database\Schema\Builder as SchemaBuilder;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
use Laravel\Telescope\TelescopeServiceProvider;
Expand Down Expand Up @@ -74,8 +74,7 @@ public function boot()
return $keyValueArray;
});

// https://laravel.com/docs/5.5/migrations#indexes
Schema::defaultStringLength(191);
SchemaBuilder::defaultStringLength(191);

Paginator::defaultView('vendor.pagination.default');

Expand Down
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions public/js/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ if (installButton) {
}, {
command: 'migrate',
description: 'Executando migrações'
}, {
command: 'reports-link',
description: 'Gerando symlinks dos relatórios'
}, {
command: 'password',
description: 'Definindo senha do admin',
Expand Down
11 changes: 6 additions & 5 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ sed -i.bak 's/APP_ENV=local/APP_ENV=production/g' .env.example && rm .env.exampl
sed -i.bak 's/APP_DEBUG=true/APP_DEBUG=false/g' .env.example && rm .env.example.bak
sed -i.bak 's/DB_HOST=postgres/DB_HOST=localhost/g' .env.example && rm .env.example.bak
composer install --no-dev --ignore-platform-reqs --optimize-autoloader
git clone https://github.com/portabilis/i-educar-reports-package.git ieducar/modules/Reports
rm -fR ieducar/modules/Reports/.git
cd ieducar/modules/Reports/ReportSources
git clone https://github.com/portabilis/i-educar-reports-package.git packages/portabilis/i-educar-reports-package
composer install --plug-and-play --no-dev --ignore-platform-reqs --optimize-autoloader
rm -fR packages/portabilis/i-educar-reports-package/.git
cd packages/portabilis/i-educar-reports-package/ieducar/ReportSources
echo "Compilando relatórios..."
for line in $(ls -a | sort | grep .jrxml | sed -e "s/\.jrxml//"); do $(../../../../vendor/cossou/jasperphp/src/JasperStarter/bin/jasperstarter cp $line.jrxml -o $line); done
for line in $(ls -a | sort | grep .jrxml | sed -e "s/\.jrxml//"); do $(../../../../../vendor/cossou/jasperphp/src/JasperStarter/bin/jasperstarter cp $line.jrxml -o $line); done
echo "Fim da compilação"
cd ../../../../../
cd ../../../../../../
tar -zcvf ieducar-${VERSION}.tar.gz ${BUILD_FOLDER}
rm -fR ${BUILD_FOLDER}
echo
Expand Down
11 changes: 6 additions & 5 deletions src/Support/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Installer
protected $commandsMap = [
'key' => 'key:generate',
'link' => 'legacy:link',
'reports-link' => 'community:reports:link',
'migrate' => 'migrate --force',
'password' => 'admin:password',
'reports' => 'reports:install --no-compile',
Expand Down Expand Up @@ -193,11 +194,11 @@ protected function getConnection(): \PDO
{
$dsn = sprintf(
'pgsql:host=%s;port=%s;dbname=%s;user=%s;password=%s',
getenv('DB_HOST'),
getenv('DB_PORT'),
getenv('DB_DATABASE'),
getenv('DB_USERNAME'),
getenv('DB_PASSWORD')
env('DB_HOST'),
env('DB_PORT'),
env('DB_DATABASE'),
env('DB_USERNAME'),
env('DB_PASSWORD')
);

return new \PDO($dsn);
Expand Down

0 comments on commit 6513f47

Please sign in to comment.