Cottage catalog: three starter recipes

Vaultwarden, Actual Budget and Uptime Kuma, each a Harbor template with a listing, an icon,
first-run notes and a smoke test. CI builds Harbor at the pinned commit and runs every
recipe's smoke test against its fake runtime.
This commit is contained in:
Michael Kinder committed 2026-11-21 13:45:14 -05:00
commit a0d992022d
21 files changed
+549

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
name: validate
on: [push, pull_request]
permissions: { contents: read }
jobs:
fake-runtime:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with: { go-version: "1.26" }
# Harbor is private: a read-only deploy key is needed (secret HARBOR_DEPLOY_KEY).
- name: Build harbord at the pinned commit
env: { HARBOR_DEPLOY_KEY: "${{ secrets.HARBOR_DEPLOY_KEY }}" }
run: |
if [ -z "$HARBOR_DEPLOY_KEY" ]; then
if [ "${{ github.event.pull_request.head.repo.full_name || github.repository }}" != "${{ github.repository }}" ]; then
echo "::notice::Pull requests from forks can't build private Harbor, so the recipe tests are skipped. A maintainer runs them before merging."
echo "skip=true" >> "$GITHUB_ENV"
exit 0
fi
echo "::error::Add the HARBOR_DEPLOY_KEY secret (a read-only deploy key on cottage-host/harbor) to run the recipe smoke tests."
exit 1
fi
mkdir -p ~/.ssh && printf '%s\n' "$HARBOR_DEPLOY_KEY" > ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519
ssh-keyscan github.com >> ~/.ssh/known_hosts
git clone -q [email protected]:cottage-host/harbor.git /tmp/harbor
git -C /tmp/harbor checkout -q "$(cat harbor.ref)"
(cd /tmp/harbor && go build -o /tmp/harbord ./cmd/harbord)
# harbord runs as root, as on a node: it hands volume directories to the containers'
# non-root users (x-harbor.volumes uid/gid), which needs root or CAP_CHOWN.
# Capacity is fixed so the runner's disk size can't refuse a pod.
- name: Smoke test every recipe
if: env.skip != 'true'
run: |
export HARBOR_DATA_DIR=$RUNNER_TEMP/h HARBOR_RUNTIME=fake HARBOR_BASE_DOMAIN=pods.test
export HARBOR_CAPACITY_CPU_MILLIS=8000 HARBOR_CAPACITY_MEMORY_MB=8192 HARBOR_CAPACITY_STORAGE_MB=65536
# The runner's sudo ignores -E, so pass Harbor's settings explicitly.
H="HARBOR_DATA_DIR=$HARBOR_DATA_DIR HARBOR_RUNTIME=$HARBOR_RUNTIME HARBOR_BASE_DOMAIN=$HARBOR_BASE_DOMAIN HARBOR_CAPACITY_CPU_MILLIS=$HARBOR_CAPACITY_CPU_MILLIS HARBOR_CAPACITY_MEMORY_MB=$HARBOR_CAPACITY_MEMORY_MB HARBOR_CAPACITY_STORAGE_MB=$HARBOR_CAPACITY_STORAGE_MB"
export HARBOR_TOKEN=$(sudo env $H /tmp/harbord token create ci | grep -o 'hbr_[A-Za-z0-9_-]*')
sudo env $H /tmp/harbord serve & sleep 2
export HARBOR_URL=http://127.0.0.1:7700
for t in apps/*/tests/smoke.sh; do sh "$t"; done