mirror of
https://github.com/saltbo/zpan.git
synced 2026-08-29 00:01:42 +08:00
0063557d09
The bundled app-version.mjs self-exec block (`import.meta.url ===
file://${process.argv[1]}`) fired at runtime once tsup inlined it into
entry-node.js, since the container runs `node dist-server/entry-node.js`.
It shelled out to `git describe`, which is absent in the image, crashing
the server on boot and leaving the compose stack unhealthy. Drop the
unused CLI entry; resolveAppVersion is still build-time inlined.
Also stop the CLI build from overwriting the `latest` tag: metadata-action
defaults to latest=auto, so cli-meta re-added a bare `latest` that, running
after the server build, clobbered it with the downloader image. Pin
latest=false on cli-meta.
Add a docker-smoke CI job that runs `docker compose up --wait` so an image
that fails to boot turns CI red, and give the GeoIP download --retry to cut
flake on that external fetch.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
14 lines
464 B
JavaScript
14 lines
464 B
JavaScript
import { execSync } from 'node:child_process'
|
|
|
|
export function resolveAppVersion() {
|
|
// The Docker build excludes .git from its context, so git describe cannot run
|
|
// there. The release pipeline passes the tag in via ZPAN_APP_VERSION instead.
|
|
if (process.env.ZPAN_APP_VERSION) {
|
|
return process.env.ZPAN_APP_VERSION
|
|
}
|
|
return execSync('git describe --tags --always --dirty', {
|
|
encoding: 'utf8',
|
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
}).trim()
|
|
}
|