Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz Source: /opt/alga-psa on psa.joliet.tech
52 lines
1.7 KiB
JavaScript
Executable File
52 lines
1.7 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
import fs from 'node:fs';
|
|
|
|
const rootComposeFiles = [
|
|
'docker-compose.ce.yaml',
|
|
'docker-compose.ee.yaml',
|
|
'docker-compose.prebuilt.ce.yaml',
|
|
'docker-compose.prebuilt.ee.yaml',
|
|
'docker-compose.imap.ce.yaml',
|
|
];
|
|
|
|
const failures = [];
|
|
|
|
function hocuspocusBlock(file) {
|
|
const text = fs.readFileSync(file, 'utf8');
|
|
const marker = /^ hocuspocus:\n/m;
|
|
const match = marker.exec(text);
|
|
if (!match) return '';
|
|
const rest = text.slice(match.index);
|
|
const nextService = rest.slice(1).search(/^ [A-Za-z0-9_-]+:\n/m);
|
|
return nextService === -1 ? rest : rest.slice(0, nextService + 1);
|
|
}
|
|
|
|
for (const file of rootComposeFiles) {
|
|
if (!fs.existsSync(file)) continue;
|
|
const block = hocuspocusBlock(file);
|
|
if (!block || !block.includes('build:')) continue;
|
|
|
|
if (!/context:\s*\.\s*(?:\n|$)/.test(block)) {
|
|
failures.push(`${file}: hocuspocus build context must be repo root (context: .)`);
|
|
}
|
|
if (!/dockerfile:\s*hocuspocus\/Dockerfile\s*(?:\n|$)/.test(block)) {
|
|
failures.push(`${file}: hocuspocus build must use hocuspocus/Dockerfile`);
|
|
}
|
|
}
|
|
|
|
const shared = fs.readFileSync('hocuspocus/docker-compose.yaml', 'utf8');
|
|
if (!/context:\s*\.\.\s*(?:\n|$)/.test(shared)) {
|
|
failures.push('hocuspocus/docker-compose.yaml: shared build context must point to repo root (context: ..)');
|
|
}
|
|
if (!/dockerfile:\s*hocuspocus\/Dockerfile\s*(?:\n|$)/.test(shared)) {
|
|
failures.push('hocuspocus/docker-compose.yaml: shared build must use hocuspocus/Dockerfile');
|
|
}
|
|
|
|
if (failures.length) {
|
|
console.error('Hocuspocus compose build configuration is inconsistent:\n');
|
|
for (const failure of failures) console.error(`- ${failure}`);
|
|
process.exit(1);
|
|
}
|
|
|
|
console.log('Hocuspocus compose build configuration is consistent.');
|