| name | release-madz | ||
|---|---|---|---|
| description | Builds and pushes all Docker images for the madz project by running npm run docker:release:all. Runs the build as a foreground process — it takes a few minutes. Reports completion status to the user. | ||
| license | MIT | ||
| compatibility | Requires Node.js 24+, npm, Docker CLI, and git with remote access. Must be run from the project root directory. | ||
| metadata |
|
⚠️ CRITICAL: This skill is idempotent but NOT retryable. Docker image tags are immutable — once1.23.0is pushed, it cannot be overwritten. A second run with the same version will fail. You cannot re-run this skill to check status or retry a failed run. The first execution is the only execution. If the build fails, you must fix the underlying issue, bump the version, and run again — not re-run this skill against the same tag.
Build and push all Docker images for the madz project. This is the final step — the moment of truth.
Before doing anything, verify the Docker image has not already been pushed. Docker image tags are immutable — a second run with the same version will fail.
# Extract version reliably using node (avoids matching nested "version" keys)
TAG_VERSION=$(node -e "console.log(require('./package.json').version)")
DOCKER_USER=${DOCKER_USER:-avoidwork}
# Verify Docker is running
docker info >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "ERROR: Docker daemon is not running. Start Docker and try again."
exit 1
fi
# Verify Docker registry authentication
docker info 2>&1 | grep -q "Login Status"
if [ $? -ne 0 ]; then
echo "WARNING: Docker registry authentication status unclear. Ensure you're logged in."
fi
# Check disk space (Docker builds need ~2GB free)
AVAILABLE_SPACE=$(df -m . | tail -1 | awk '{print $4}')
if [ "$AVAILABLE_SPACE" -lt 2048 ]; then
echo "WARNING: Less than 2GB disk space available. Build may fail."
fi
# Check if the image already exists in the registry
# Note: docker manifest inspect requires registry access; may fail if registry is unreachable
docker manifest inspect "${DOCKER_USER}/madz:${TAG_VERSION}" >/dev/null 2>&1 && echo "EXISTS" || echo "NOT_FOUND"If the image already exists in the registry, stop and ask. Do not proceed — the release was already pushed.
Also verify the git tag exists locally (for context, not as the primary check):
git tag -l "${TAG_VERSION}"If the git tag is missing, warn the user but do not block — the tag may have been pushed separately.
Run npm run docker:release:all as a foreground process. This takes a few minutes. The skill description says "foreground" — do not background it.
npm run docker:release:allWait for the process to exit, then check the exit code:
- exit code 0 — Success. All images built and pushed.
- non-zero exit code — Failure. Capture the last 10 lines of output for context.
Note on retryability: The warning at the top of this skill says the skill is "NOT retryable" — this means you cannot re-run this skill against the same tag (Docker image tags are immutable). If the build fails, you can report the failure and stop. The user must fix the underlying issue, bump the version, and run the skill again with the new version. This step is about handling the failure of the current run, not about retrying the same tag.
Print a final summary using actual variable values:
Release complete.
Status: SUCCESS / FAILED
Images built and pushed.
Version: $TAG_VERSION
Docker user: $DOCKER_USER
If the build fails, include the last 10 lines of output for context.