feat(release): RELEASE identity + image tag single-sourcing (#10)
- RELEASE file: single source of release version (0.0.X until declared stable) - common.sh load_release(): validates version, derives MOSAIC_IMAGE_TAG=mosaic-poc-agent:<pi>-r<release> from the pinned pi dep - compose.yaml: image tag is required env; build/hello/verify call load_release - verify.sh derives the image name instead of hardcoding it - package.json version aligned to the same 0.0.X line Closes #10
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Containerfile
|
dockerfile: Containerfile
|
||||||
image: mosaic-poc-agent:0.84.4
|
image: ${MOSAIC_IMAGE_TAG:?MOSAIC_IMAGE_TAG must be set by scripts/load_release (run via scripts/*.sh)}
|
||||||
user: "1000:1000"
|
user: "1000:1000"
|
||||||
environment:
|
environment:
|
||||||
# Resolved from config.json by scripts/common.sh (load_config).
|
# Resolved from config.json by scripts/common.sh (load_config).
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mosaic-stack-dev-test",
|
"name": "mosaic-stack-dev-test",
|
||||||
"version": "0.1.0",
|
"version": "0.0.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Minimal Mosaic Stack container proof of concept: one Pi agent, four local contract files, one real model request returning MOSAIC_HELLO_OK.",
|
"description": "Minimal Mosaic Stack container proof of concept: one Pi agent, four local contract files, one real model request returning MOSAIC_HELLO_OK.",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ cd "$(dirname "$0")/.."
|
|||||||
source scripts/common.sh
|
source scripts/common.sh
|
||||||
|
|
||||||
load_config
|
load_config
|
||||||
|
load_release
|
||||||
|
|
||||||
bootstrap_runtime_dir
|
bootstrap_runtime_dir
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,21 @@ load_config() {
|
|||||||
MOSAIC_DEV_DIR="$MOSAIC_DATA_ROOT"
|
MOSAIC_DEV_DIR="$MOSAIC_DATA_ROOT"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Resolve the release identity: RELEASE is the single source of the
|
||||||
|
# release version (stays 0.0.X until declared stable); the image tag
|
||||||
|
# derives from it plus the pinned pi dependency version.
|
||||||
|
load_release() {
|
||||||
|
local release pi_version
|
||||||
|
release="$(tr -d '[:space:]' < RELEASE)"
|
||||||
|
if ! printf '%s' "$release" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
|
||||||
|
echo "common: RELEASE must be a semver-ish version, got: '$release'" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
pi_version="$(node -p "require('./package.json').dependencies['@earendil-works/pi-coding-agent']")"
|
||||||
|
export MOSAIC_RELEASE="$release"
|
||||||
|
export MOSAIC_IMAGE_TAG="mosaic-poc-agent:${pi_version}-r${release}"
|
||||||
|
}
|
||||||
|
|
||||||
# Ensure the configured runtime data directory exists and carries this
|
# Ensure the configured runtime data directory exists and carries this
|
||||||
# project's ownership marker. The marker is what scripts/reset.sh requires
|
# project's ownership marker. The marker is what scripts/reset.sh requires
|
||||||
# before it will delete anything.
|
# before it will delete anything.
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ cd "$(dirname "$0")/.."
|
|||||||
source scripts/common.sh
|
source scripts/common.sh
|
||||||
|
|
||||||
load_config
|
load_config
|
||||||
|
load_release
|
||||||
|
|
||||||
bootstrap_runtime_dir
|
bootstrap_runtime_dir
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -14,10 +14,11 @@ cd "$(dirname "$0")/.."
|
|||||||
# shellcheck source=common.sh
|
# shellcheck source=common.sh
|
||||||
source scripts/common.sh
|
source scripts/common.sh
|
||||||
|
|
||||||
IMAGE="mosaic-poc-agent:0.84.4"
|
|
||||||
EXPECTED="${EXPECTED_MARKER:-MOSAIC_HELLO_OK}"
|
EXPECTED="${EXPECTED_MARKER:-MOSAIC_HELLO_OK}"
|
||||||
|
|
||||||
load_config
|
load_config
|
||||||
|
load_release
|
||||||
|
IMAGE="$MOSAIC_IMAGE_TAG"
|
||||||
|
|
||||||
# Ensure the configured data root exists (host-owned) before the mount,
|
# Ensure the configured data root exists (host-owned) before the mount,
|
||||||
# otherwise Docker would auto-create a root-owned directory.
|
# otherwise Docker would auto-create a root-owned directory.
|
||||||
|
|||||||
Reference in New Issue
Block a user