fix: refresh root deps during deploy
Add a root bun install after git pull so file: dependencies are refreshed before build and runtime verification.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
"build:all": "bun run build && bun run dashboard:build && bun run build:runners",
|
||||
"build:runtime": "bun run build:all",
|
||||
"verify:dist": "bash scripts/check-dist-fresh.sh",
|
||||
"deploy": "git pull --ff-only && bun run build:all && bun run verify:dist && bun setup/index.ts --step migrate-room-registrations && systemctl --user restart ejclaw",
|
||||
"deploy": "git pull --ff-only && bun install --frozen-lockfile && bun run build:all && bun run verify:dist && bun setup/index.ts --step migrate-room-registrations && systemctl --user restart ejclaw",
|
||||
"start": "bun dist/index.js",
|
||||
"dev": "bun --watch src/index.ts",
|
||||
"test": "vitest run",
|
||||
|
||||
27
src/deploy-script.test.ts
Normal file
27
src/deploy-script.test.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
type PackageJson = {
|
||||
scripts?: Record<string, string>;
|
||||
};
|
||||
|
||||
describe('deploy script', () => {
|
||||
it('refreshes root file dependencies after pulling before building', () => {
|
||||
const packageJson = JSON.parse(
|
||||
fs.readFileSync(
|
||||
path.resolve(import.meta.dirname, '../package.json'),
|
||||
'utf8',
|
||||
),
|
||||
) as PackageJson;
|
||||
|
||||
const deploy = packageJson.scripts?.deploy ?? '';
|
||||
const pullIndex = deploy.indexOf('git pull --ff-only');
|
||||
const rootInstallIndex = deploy.indexOf('bun install --frozen-lockfile');
|
||||
const buildIndex = deploy.indexOf('bun run build:all');
|
||||
|
||||
expect(pullIndex).toBeGreaterThanOrEqual(0);
|
||||
expect(rootInstallIndex).toBeGreaterThan(pullIndex);
|
||||
expect(rootInstallIndex).toBeLessThan(buildIndex);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user