mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-04 16:16:46 +00:00
chore(docker): skip ccs postinstall in legacy image
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { readFileSync } from 'fs';
|
||||
import { describe, expect, it } from 'bun:test';
|
||||
|
||||
const dockerfile = readFileSync('docker/Dockerfile', 'utf8');
|
||||
const entrypoint = readFileSync('docker/entrypoint.sh', 'utf8');
|
||||
|
||||
describe('legacy Dockerfile lifecycle scripts', () => {
|
||||
it('skips package lifecycle scripts for every CCS install during image build', () => {
|
||||
const ccsInstallCommands = dockerfile
|
||||
.split('\n')
|
||||
.filter((line) => line.includes('npm install') && line.includes('@kaitranntt/ccs'));
|
||||
|
||||
expect(ccsInstallCommands.length).toBeGreaterThan(0);
|
||||
for (const command of ccsInstallCommands) {
|
||||
expect(command).toContain('--ignore-scripts');
|
||||
}
|
||||
});
|
||||
|
||||
it('creates the runtime CCS home directory from the entrypoint instead', () => {
|
||||
expect(entrypoint).toContain('ccs_home_dir="${CCS_HOME_DIR:-/home/node/.ccs}"');
|
||||
expect(entrypoint).toContain('mkdir -p "$ccs_home_dir"');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user