Computes a version record, marks it stamped and writes it as version.json
into a directory, so it ships with the artifact.
The build number is buildNumberFrom()'s: the build instant, or a
release's own number. A release flag without a valid number THROWS
(STS-CORE-0164) and writes nothing — that refusal is what stops an
image building; a failure to write is logged, not thrown, as it always
was. The release is VERSION's unless STS_VERSION_RELEASE names one,
which must be M.N.O exactly or the stamp THROWS (STS-CORE-0175) and
writes nothing.
Parameters
dir: any
the directory to write into, created if missing
env: any
optional; the environment to read STS_RELEASE, BUILD_NUMBER
and STS_VERSION_RELEASE from, process.env when omitted
Computes a version record, marks it stamped and writes it as version.json into a directory, so it ships with the artifact.
The build number is buildNumberFrom()'s: the build instant, or a release's own number. A release flag without a valid number THROWS (
STS-CORE-0164) and writes nothing — that refusal is what stops an image building; a failure to write is logged, not thrown, as it always was. The release is VERSION's unlessSTS_VERSION_RELEASEnames one, which must be M.N.O exactly or the stamp THROWS (STS-CORE-0175) and writes nothing.