OpenParable
Skip to content
← Back to skills

Deploy Webicached

DevOps & Security
deploy-webicached

Deploy Webicached is an Agent Skill for devops & security published in the webinstall/webi-installers repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Deploy webicached binary to beta.webi.sh. Use when building, uploading, or restarting the cache daemon. Covers cross-compile, conf sync, service management.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/webinstall/webi-installers/blob/HEAD/skills/deploy-webicached/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/deploy-webicached, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

One-step deploy

./scripts/deploy-webicached.sh beta.webi.sh

Builds with version ldflags, stops service, uploads, syncs conf, starts, verifies.

Manual steps (if needed)

Build

VERSION="$(git describe --tags --always)"
COMMIT="$(git rev-parse --short HEAD)"
DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
GOOS=linux GOARCH=amd64 GOAMD64=v2 go build \
  -ldflags "-X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${DATE}" \
  -o agents/tmp/webicached ./cmd/webicached

MUST: Build from the ref-webi-go worktree (or branch containing cmd/webicached).

Deploy

ssh beta.webi.sh "serviceman stop webicached"
scp agents/tmp/webicached beta.webi.sh:~/bin/webicached

MUST: Stop service before scp — Linux refuses to overwrite a running binary.

Sync releases.conf

rsync -av --include='*/' --include='releases.conf' --exclude='*' \
  ./ beta.webi.sh:~/srv/beta.webinstall.dev/installers/

MUST: Run from the worktree root. The server has no checkout of this branch — conf files must be synced explicitly.

Start

ssh beta.webi.sh "serviceman start webicached"

Verify

ssh beta.webi.sh "sleep 5 && serviceman logs webicached"

Expected: "batch: N stale, refreshing 20" or "all packages fresh, sleeping 9s"

Smoke test

ssh beta.webi.sh "curl -sSf http://localhost:3080/api/releases/bat.json | head -c 100"
ssh beta.webi.sh "curl -sSf -A 'curl/7.81.0 Linux x86_64' http://localhost:3080/api/installers/bat.sh | head -3"

Expected: JSON array with release objects; shell script with PKG_NAME='bat'.

Service management

serviceman status webicached
serviceman restart webicached
serviceman logs webicached

Server layout

PathPurpose
~/bin/webicachedBinary
~/srv/beta.webinstall.dev/installers/Conf dir (releases.conf files)
~/.cache/webi/legacy/Cache output (fsstore, legacy JSON format)
~/.cache/webi/raw/Raw upstream API responses
~/srv/beta.webinstall.dev/.env.secretGITHUB_TOKEN
/etc/systemd/system/webicached.serviceService unit (created by serviceman)

Flags reference

FlagDefaultPurpose
--conf.Dir with {pkg}/releases.conf files
--legacy~/.cache/webi/legacyLegacy cache output directory
--raw~/.cache/webi/rawRaw upstream response cache
--token$GITHUB_TOKENGitHub API token
--interval9sDelay between package fetches in a batch
--oncefalseRun once then exit
--eagerfalseFetch all on startup (not staleness-based)
--shallowfalseOnly first page of releases
--no-fetchfalseClassify from rawcache only
--page-delay2sDelay between paginated API pages

One-shot refresh (specific packages)

ssh beta.webi.sh ". ~/srv/beta.webinstall.dev/.env.secret && ~/bin/webicached \
  --conf ~/srv/beta.webinstall.dev/installers/ \
  --raw ~/.cache/webi/raw \
  --once bat goreleaser"