Renames `harmony-fleet-operator-release` to `harmony-fleet-release` and adds a `--component <operator|agent|nats-callout>` flag. The binary's surface is now app-scoped (one binary per app, all fleet components behind a flag) rather than component-scoped (one binary per component), matching ADR-023's "deploy binary statically lists its supported components" guidance. Why: adding the agent and nats-callout release pipelines later would otherwise mean three near-identical binaries with copy-pasted docker/helm orchestration. Folding them under one binary keeps the shared 90% in one place and reduces each new component to: - a new `Component` enum variant - a `Component::spec` arm naming the Dockerfile + image - a `hydrate_chart` arm pointing at the component's `build_chart` `agent` and `nats-callout` variants exist today but bail with an actionable error pointing at the roadmap; this keeps `--help` honest about what's coming without lying about what works. The per-component `release.sh` wrapper pattern stays: each component's script (today `fleet/harmony-fleet-operator/release.sh`, tomorrow agent's and callout's) is a 1-line wrapper that pre-fills `--component`. This lets a tag like `harmony-fleet-operator-v0.1.0` route to the right component via the existing CI workflow without the operator having to remember a flag. File renamed via `git mv` so blame history is preserved. Verified on k3d with `--component operator --no-push`: produces the same image + chart pair as before.
33 lines
1.2 KiB
Bash
Executable File
33 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build + push the harmony-fleet-operator image and helm chart at one
|
|
# matching version. Invoked locally and by .gitea CI.
|
|
#
|
|
# ./fleet/harmony-fleet-operator/release.sh <registry> <version>
|
|
# ./fleet/harmony-fleet-operator/release.sh hub.nationtech.io v0.1.0
|
|
#
|
|
# Expects `docker login <registry>` and `helm registry login <registry>`
|
|
# to have already been run; both are cheap one-liners and let CI use the
|
|
# same script unchanged.
|
|
#
|
|
# This is the operator-specific 1-line wrapper around the app-scoped
|
|
# `harmony-fleet-release` binary. The wrapper exists so a tag like
|
|
# `harmony-fleet-operator-v0.1.0` routes straight to the right
|
|
# `--component` without the caller having to remember the flag. Agent
|
|
# and nats-callout will get sibling `release.sh` scripts the same way.
|
|
#
|
|
# All heavy lifting (docker build/push, chart hydration, helm
|
|
# package/push) is in the binary; this script just selects the
|
|
# component.
|
|
|
|
set -euo pipefail
|
|
|
|
REGISTRY="${1:?usage: release.sh <registry> <version>}"
|
|
VERSION="${2:?usage: release.sh <registry> <version>}"
|
|
|
|
cd "$(dirname "$0")/../.."
|
|
|
|
exec cargo run --release -p harmony-fleet-deploy \
|
|
--bin harmony-fleet-release -- \
|
|
--component operator \
|
|
--registry "$REGISTRY" --version "$VERSION"
|