Files
device-management/scripts/install-self-hosted.ps1
T
Wian Drs 1e80be180e
tests / ci (push) Has been cancelled
Initial commit device-management
2026-08-25 09:42:00 +07:00

17 lines
815 B
PowerShell

param([string]$Php = 'C:\php83\php.exe')
$ErrorActionPreference = 'Stop'
if (-not (Test-Path -LiteralPath $Php)) { throw "PHP tidak ditemukan: $Php" }
if (-not (Test-Path -LiteralPath '.env')) { Copy-Item -LiteralPath '.env.example' -Destination '.env' }
Write-Host 'Atur DB_HOST, DB_DATABASE, DB_USERNAME, DB_PASSWORD dan DEPLOYMENT_MODE=self_hosted pada .env.'
$confirmation = Read-Host 'Ketik LANJUT setelah .env selesai diatur'
if ($confirmation -ne 'LANJUT') { throw 'Instalasi dibatalkan.' }
& composer install --no-dev --optimize-autoloader
& $Php artisan key:generate --force
& $Php artisan migrate --force
& $Php artisan db:seed --force
& $Php artisan app:install-tenant
& npm ci
& npm run build
& $Php artisan optimize
Write-Host 'Instalasi RADIQ NDM selesai. Konfigurasikan web server ke folder public.'