Publish only the distroless Flood runtime as latest
This commit is contained in:
1 parent
66e87558ce
commit
b1657c3b61
7 files changed
+59
-253
No files matched your search
+8
-3
@@ -1,12 +1,17 @@
|
||||
const {spawn} = require('node:child_process');
|
||||
const {spawn, execFileSync} = require('node:child_process');
|
||||
const http = require('node:http');
|
||||
const fs = require('node:fs');
|
||||
const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
for (const file of ['/bin/sh', '/bin/bash', '/bin/busybox', '/sbin/apk', '/usr/local/bin/npm']) {
|
||||
if (fs.existsSync(file)) throw new Error(`Unexpected runtime tool: ${file}`);
|
||||
}
|
||||
execFileSync('mediainfo', ['--Version'], {stdio: 'inherit'});
|
||||
execFileSync('df', ['--version'], {stdio: 'inherit'});
|
||||
const runDir = fs.mkdtempSync(path.join(os.tmpdir(), 'flood-smoke-'));
|
||||
const child = spawn('npm', ['run', 'start', '--',
|
||||
const child = spawn(process.execPath, ['--enable-source-maps', '--use_strict', 'dist/index.js',
|
||||
'--host=127.0.0.1', '--port=3000', `--rundir=${runDir}`],
|
||||
{stdio: 'inherit', detached: true});
|
||||
{cwd: '/usr/src/app', stdio: 'inherit', detached: true});
|
||||
let startupError;
|
||||
child.on('error', error => { startupError = error; });
|
||||
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
|
||||
|
||||
Reference in new issue
Block a user