Improve build/install scripts for multiple apps
Switch development builds to production and harden install/update steps across several apps. - Akaunting: use `npm run production` instead of `npm run dev` in both install and update scripts to produce production assets. - Blinko: make bun installs run with `--unsafe-perm`, run `bun run build:web` and `bun run build:seed`, copy built public assets into `/opt/blinko/server/public`, run prisma migrations, and execute the generated seed script. Add PORT and NEXT_PUBLIC_BASE_URL to the .env. Update the systemd service to use WorkingDirectory `/opt/blinko/server` and start the app with `node /opt/blinko/dist/index.js`. - InvoiceShelf & SolidTime: stop capturing APP_KEY via `php artisan key:generate --show` + sed; instead run `php artisan key:generate` during install after composer install. SolidTime also runs `php artisan storage:link` after build. These changes simplify key generation and ensure proper storage linking. Overall these updates ensure production-ready builds, proper artifact placement, and correct runtime configuration for services.
This commit is contained in:
@@ -52,7 +52,7 @@ function update_script() {
|
||||
cd /opt/akaunting
|
||||
$STD composer install --no-dev --optimize-autoloader
|
||||
$STD npm install
|
||||
$STD npm run dev
|
||||
$STD npm run production
|
||||
$STD php artisan migrate --force
|
||||
$STD php artisan optimize:clear
|
||||
chown -R www-data:www-data /opt/akaunting
|
||||
|
||||
@@ -47,9 +47,12 @@ function update_script() {
|
||||
|
||||
msg_info "Updating Application"
|
||||
cd /opt/blinko
|
||||
$STD bun install
|
||||
$STD bun install --unsafe-perm
|
||||
$STD bun run build:web
|
||||
$STD bun run build:seed
|
||||
mkdir -p /opt/blinko/server/public
|
||||
cp -r /opt/blinko/dist/public/. /opt/blinko/server/public/ 2>/dev/null || true
|
||||
$STD bunx prisma migrate deploy
|
||||
$STD bun run build
|
||||
msg_ok "Updated Application"
|
||||
|
||||
msg_info "Starting Service"
|
||||
|
||||
Reference in New Issue
Block a user