Release / update-version (push) Has been cancelled
Release / build-frontend (push) Has been cancelled
Release / release (push) Has been cancelled
Release / sync-version-file (push) Has been cancelled
CI / shell (push) Canceled after 0s
CI / test (push) Canceled after 0s
CI / frontend (push) Canceled after 0s
CI / golangci-lint (push) Canceled after 0s
Security Scan / backend-security (push) Canceled after 0s
Security Scan / frontend-security (push) Canceled after 0s
35 lines
1015 B
Bash
Executable File
35 lines
1015 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
repo_root=$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)
|
|
cd "$repo_root"
|
|
|
|
fail() {
|
|
printf 'docker runtime resources test failed: %s\n' "$1" >&2
|
|
exit 1
|
|
}
|
|
|
|
assert_line() {
|
|
file=$1
|
|
line=$2
|
|
grep -Fqx "$line" "$file" || fail "$file is missing: $line"
|
|
}
|
|
|
|
assert_count() {
|
|
file=$1
|
|
line=$2
|
|
expected=$3
|
|
actual=$(grep -Fxc "$line" "$file" || true)
|
|
[ "$actual" -eq "$expected" ] || fail "$file has $actual occurrences of '$line', expected $expected"
|
|
}
|
|
|
|
test -s backend/resources/model-pricing/model_prices_and_context_window.json || \
|
|
fail 'fallback pricing data is missing or empty'
|
|
|
|
assert_line Dockerfile.goreleaser 'COPY --chown=sub2api:sub2api backend/resources /app/resources'
|
|
assert_line deploy/Dockerfile 'COPY --from=backend-builder --chown=sub2api:sub2api /app/backend/resources /app/resources'
|
|
assert_count .goreleaser.yaml ' - backend/resources' 4
|
|
assert_count .goreleaser.simple.yaml ' - backend/resources' 1
|
|
|
|
printf 'docker runtime resources test passed\n'
|