feat(deploy): add release manifest with pinned base image digests
This commit is contained in:
1 parent
ea0982a762
commit
a0551a34b8
18 files changed
+2316
-21
No files matched your search
+26
-3
@@ -1,9 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
# Isolated technical smoke of the core stack.
|
||||
#
|
||||
# Optional environment:
|
||||
# LINCODEX_RELEASE_TAG run against the release images of this tag (built
|
||||
# by make -C deploy release-build) without building or
|
||||
# pulling, and record passing evidence for the release
|
||||
# manifest. Only make -C deploy release-smoke sets it.
|
||||
set -euo pipefail
|
||||
|
||||
root=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
|
||||
compose_file="$root/deploy/docker/docker-compose.yml"
|
||||
release_file="$root/deploy/docker/docker-compose.release.yml"
|
||||
release_script="$root/deploy/scripts/release_manifest.py"
|
||||
env_file="$root/.env.example"
|
||||
release_tag="${LINCODEX_RELEASE_TAG:-}"
|
||||
compose_files=(-f "$compose_file")
|
||||
up_args=(--build)
|
||||
if [[ -n "$release_tag" ]]; then
|
||||
compose_files+=(-f "$release_file")
|
||||
up_args=(--no-build --pull never)
|
||||
fi
|
||||
project=lincodex-smoke
|
||||
app_network="${project}_default"
|
||||
port=18080
|
||||
@@ -15,10 +31,10 @@ started=0
|
||||
# .env.example and points mail links at its own loopback port.
|
||||
compose() {
|
||||
APP_PROJECT="$project" APP_NETWORK="$app_network" APP_STORAGE_NETWORK="$storage_network" APP_HTTP_PORT="$port" \
|
||||
APP_PUBLIC_URL="http://localhost:$port" docker compose \
|
||||
APP_PUBLIC_URL="http://localhost:$port" LINCODEX_RELEASE_TAG="$release_tag" docker compose \
|
||||
--env-file "$env_file" \
|
||||
-p "$project" \
|
||||
-f "$compose_file" \
|
||||
"${compose_files[@]}" \
|
||||
"$@"
|
||||
}
|
||||
|
||||
@@ -44,6 +60,9 @@ if [[ -n "$(compose ps -q 2>/dev/null || true)" ]]; then
|
||||
printf 'Refusing to use existing Compose project %s.\n' "$project" >&2
|
||||
exit 2
|
||||
fi
|
||||
if [[ -n "$release_tag" ]]; then
|
||||
PYTHONDONTWRITEBYTECODE=1 python3 "$release_script" require-images --tag "$release_tag"
|
||||
fi
|
||||
|
||||
cleanup() {
|
||||
local result=$?
|
||||
@@ -60,7 +79,7 @@ trap cleanup EXIT
|
||||
|
||||
compose config --quiet
|
||||
started=1
|
||||
compose up --build -d --wait --wait-timeout 120
|
||||
compose up "${up_args[@]}" -d --wait --wait-timeout 120
|
||||
|
||||
wait_for() {
|
||||
local url=$1
|
||||
@@ -165,4 +184,8 @@ fi
|
||||
curl --fail --silent --show-error "http://127.0.0.1:$port/api/v1/healthz" >/dev/null
|
||||
compose up -d --wait --wait-timeout 90 seaweedfs
|
||||
wait_for_readiness
|
||||
if [[ -n "$release_tag" ]]; then
|
||||
# Every check above passed; bind the result to the image IDs that ran.
|
||||
PYTHONDONTWRITEBYTECODE=1 python3 "$release_script" record-evidence --check smoke --project "$project" --tag "$release_tag"
|
||||
fi
|
||||
printf '%s\n' 'Technical smoke passed: frontend, API routing, PostgreSQL, Redis, SeaweedFS, dependency recovery, storage authentication and network isolation, and the disabled mail transport.'
|
||||
Reference in new issue
Block a user