fix: modernize docker publishing
This commit is contained in:
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
node --input-type=module <<'NODE'
|
||||
import fs from 'node:fs';
|
||||
import { execFileSync } from 'node:child_process';
|
||||
|
||||
const readJson = (path) => JSON.parse(fs.readFileSync(path, 'utf8'));
|
||||
const arch = process.arch === 'x64' ? 'amd64' : process.arch;
|
||||
|
||||
const checks = {
|
||||
packageVersion: readJson('/app/package.json').version,
|
||||
hasCli: fs.existsSync('/app/cli.js'),
|
||||
hasRustBinary: fs.existsSync(`/app/dist_rust/remoteingress-bin_linux_${arch}`) || fs.existsSync('/app/dist_rust/remoteingress-bin'),
|
||||
};
|
||||
|
||||
await import('/app/dist_ts/index.js');
|
||||
execFileSync('node', ['/app/cli.js', '--help'], { stdio: 'pipe' });
|
||||
|
||||
if (checks.packageVersion !== '4.17.1') {
|
||||
throw new Error(`Unexpected remoteingress package version ${checks.packageVersion}`);
|
||||
}
|
||||
if (!checks.hasCli) {
|
||||
throw new Error('Missing cli.js');
|
||||
}
|
||||
if (!checks.hasRustBinary) {
|
||||
throw new Error(`Missing Rust binary for ${arch}`);
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(checks));
|
||||
NODE
|
||||
Reference in New Issue
Block a user