build(taskfile): drop unused tasks and share the dev State Store wait
This commit is contained in:
2 files changed
+14
-120
No files matched your search
+13
-119
@@ -4,40 +4,6 @@ vars:
|
|||||||
BIN_DIR: "bin"
|
BIN_DIR: "bin"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
default:
|
|
||||||
desc: List available tasks
|
|
||||||
cmds:
|
|
||||||
- task --list
|
|
||||||
|
|
||||||
setup:
|
|
||||||
desc: Install the pinned tooling and dependencies a checkout needs
|
|
||||||
cmds:
|
|
||||||
# Report what this task cannot install for you, so a missing Go, Node or
|
|
||||||
# Docker fails here by name rather than somewhere inside the gate.
|
|
||||||
- |
|
|
||||||
set -eu
|
|
||||||
missing=
|
|
||||||
for tool in go task node npm docker; do
|
|
||||||
command -v "$tool" >/dev/null 2>&1 || missing="$missing $tool"
|
|
||||||
done
|
|
||||||
if [ -n "$missing" ]; then
|
|
||||||
echo "warning: not installed (AGENTS.md, Build and gate):$missing" >&2
|
|
||||||
fi
|
|
||||||
# The pin is one file, read here and by .github/workflows, so the linter
|
|
||||||
# running locally and the one running the gate cannot drift apart.
|
|
||||||
- |
|
|
||||||
set -eu
|
|
||||||
want=$(cat {{.ROOT_DIR}}/.golangci-version)
|
|
||||||
have=$(golangci-lint --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true)
|
|
||||||
if [ "$have" = "${want#v}" ]; then
|
|
||||||
echo "golangci-lint $want already installed"
|
|
||||||
else
|
|
||||||
echo "installing golangci-lint $want (have: ${have:-none})"
|
|
||||||
GOBIN="$(go env GOPATH)/bin" go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$want"
|
|
||||||
fi
|
|
||||||
- task: proto:install
|
|
||||||
- task: ui:deps
|
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
desc: Fix and format Go source with the gate's configured formatters
|
desc: Fix and format Go source with the gate's configured formatters
|
||||||
cmds:
|
cmds:
|
||||||
@@ -117,23 +83,7 @@ tasks:
|
|||||||
desc: Run golangci-lint
|
desc: Run golangci-lint
|
||||||
cmds:
|
cmds:
|
||||||
- golangci-lint run ./...
|
- golangci-lint run ./...
|
||||||
- task: lint:tools
|
- cd tools && golangci-lint run ./...
|
||||||
|
|
||||||
lint:tools:
|
|
||||||
desc: Run golangci-lint over the tools module
|
|
||||||
dir: tools
|
|
||||||
cmds:
|
|
||||||
- golangci-lint run ./...
|
|
||||||
|
|
||||||
vuln:
|
|
||||||
desc: Scan for known vulnerabilities (requires network access)
|
|
||||||
cmds:
|
|
||||||
- govulncheck ./...
|
|
||||||
|
|
||||||
deadcode:
|
|
||||||
desc: Report unreachable production functions (advisory)
|
|
||||||
cmds:
|
|
||||||
- go run golang.org/x/tools/cmd/deadcode@latest -test=false ./cmd/...
|
|
||||||
|
|
||||||
ui:deps:
|
ui:deps:
|
||||||
desc: Install dashboard dependencies
|
desc: Install dashboard dependencies
|
||||||
@@ -165,11 +115,6 @@ tasks:
|
|||||||
- npm test
|
- npm test
|
||||||
- npm run typecheck
|
- npm run typecheck
|
||||||
|
|
||||||
webhook:send:
|
|
||||||
desc: Send a test event to the dashboard's capture intake (--help for kinds)
|
|
||||||
cmds:
|
|
||||||
- bash tools/webhook-send.sh {{.CLI_ARGS}}
|
|
||||||
|
|
||||||
bench:prreview:
|
bench:prreview:
|
||||||
desc: Run the PR review benchmark on the configured models and write docs/benchmarks/pr-review-*.md (-- -model ALIAS -judge-model REF; --help for flags)
|
desc: Run the PR review benchmark on the configured models and write docs/benchmarks/pr-review-*.md (-- -model ALIAS -judge-model REF; --help for flags)
|
||||||
cmds:
|
cmds:
|
||||||
@@ -214,17 +159,21 @@ tasks:
|
|||||||
echo "postgres did not become healthy within 60s" >&2
|
echo "postgres did not become healthy within 60s" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
dev:daemon:
|
dev:wait-state:
|
||||||
desc: Run archied with live reload
|
internal: true
|
||||||
cmds:
|
cmds:
|
||||||
- |
|
- |
|
||||||
# The daemon and Gateway read their settings from the State Store at
|
# Services read their settings from the State Store at boot and exit
|
||||||
# boot and exit if it is not up yet; it starts only once PostgreSQL
|
# if it is not up yet, so wait for its port ([services.state] in
|
||||||
# is healthy, so wait for its port ([services.state] in
|
# deployments/dev.toml).
|
||||||
# deployments/dev.toml) first.
|
|
||||||
for _ in $(seq 1 120); do nc -z 127.0.0.1 9091 && exit 0; sleep 1; done
|
for _ in $(seq 1 120); do nc -z 127.0.0.1 9091 && exit 0; sleep 1; done
|
||||||
echo "state store did not come up on 127.0.0.1:9091 within 120s" >&2
|
echo "state store did not come up on 127.0.0.1:9091 within 120s" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
|
dev:daemon:
|
||||||
|
desc: Run archied with live reload
|
||||||
|
cmds:
|
||||||
|
- task: dev:wait-state
|
||||||
- air -build.args_bin="-config-overlay,deployments/dev.toml"
|
- air -build.args_bin="-config-overlay,deployments/dev.toml"
|
||||||
|
|
||||||
dev:dashboard:
|
dev:dashboard:
|
||||||
@@ -241,20 +190,13 @@ tasks:
|
|||||||
dev:gateway:
|
dev:gateway:
|
||||||
desc: Run the development Gateway
|
desc: Run the development Gateway
|
||||||
cmds:
|
cmds:
|
||||||
- |
|
- task: dev:wait-state
|
||||||
# The daemon and Gateway read their settings from the State Store at
|
|
||||||
# boot and exit if it is not up yet; it starts only once PostgreSQL
|
|
||||||
# is healthy, so wait for its port ([services.state] in
|
|
||||||
# deployments/dev.toml) first.
|
|
||||||
for _ in $(seq 1 120); do nc -z 127.0.0.1 9091 && exit 0; sleep 1; done
|
|
||||||
echo "state store did not come up on 127.0.0.1:9091 within 120s" >&2
|
|
||||||
exit 1
|
|
||||||
- go run ./cmd/archie-gateway -config-overlay deployments/dev.toml
|
- go run ./cmd/archie-gateway -config-overlay deployments/dev.toml
|
||||||
|
|
||||||
dev:messaging:
|
dev:messaging:
|
||||||
desc: Run the development Messaging Service
|
desc: Run the development Messaging Service
|
||||||
cmds:
|
cmds:
|
||||||
- for _ in $(seq 1 120); do nc -z 127.0.0.1 9091 && exit 0; sleep 1; done; echo "state store did not come up on 127.0.0.1:9091 within 120s" >&2; exit 1
|
- task: dev:wait-state
|
||||||
- go run ./cmd/archie-messaging -config-overlay deployments/dev.toml
|
- go run ./cmd/archie-messaging -config-overlay deployments/dev.toml
|
||||||
|
|
||||||
dev:ui:
|
dev:ui:
|
||||||
@@ -280,24 +222,6 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- node e2e/run.cjs {{.CLI_ARGS}}
|
- node e2e/run.cjs {{.CLI_ARGS}}
|
||||||
|
|
||||||
dev:mobile:
|
|
||||||
desc: Serve the dashboard on your LAN (token-protected) for phone viewing
|
|
||||||
deps:
|
|
||||||
- ui
|
|
||||||
cmds:
|
|
||||||
- cmd: |
|
|
||||||
IP=$(hostname -I | awk '{print $1}')
|
|
||||||
TOKEN_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/archie/web-token"
|
|
||||||
go run ./cmd/archie-ui -listen 0.0.0.0:8484 -token-file "$TOKEN_FILE" &
|
|
||||||
UI_PID=$!
|
|
||||||
sleep 2
|
|
||||||
TOKEN=$(cat "$TOKEN_FILE" 2>/dev/null)
|
|
||||||
URL="http://$IP:8484/?t=$TOKEN"
|
|
||||||
echo "Phone URL: $URL"
|
|
||||||
echo "$URL" | qrencode -t ANSIUTF8
|
|
||||||
trap "kill $UI_PID 2>/dev/null" EXIT
|
|
||||||
wait $UI_PID
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
desc: Build archie services and agent binaries
|
desc: Build archie services and agent binaries
|
||||||
vars:
|
vars:
|
||||||
@@ -332,11 +256,6 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- go test -short ./...
|
- go test -short ./...
|
||||||
|
|
||||||
test:full:
|
|
||||||
desc: Run the whole Go test suite uncached, including the wall-clock-bound tests
|
|
||||||
cmds:
|
|
||||||
- go test ./... -count=1
|
|
||||||
|
|
||||||
check:
|
check:
|
||||||
desc: Run the full quality gate
|
desc: Run the full quality gate
|
||||||
# Finish mutations before starting parallel checks.
|
# Finish mutations before starting parallel checks.
|
||||||
@@ -385,28 +304,3 @@ tasks:
|
|||||||
- tools/publish.sh {{.VERSION}}
|
- tools/publish.sh {{.VERSION}}
|
||||||
requires:
|
requires:
|
||||||
vars: [VERSION]
|
vars: [VERSION]
|
||||||
|
|
||||||
clean:
|
|
||||||
desc: Remove build artifacts
|
|
||||||
cmds:
|
|
||||||
- rm -rf {{.BIN_DIR}}
|
|
||||||
|
|
||||||
docker-build:
|
|
||||||
desc: Build the archie-agent sandbox image
|
|
||||||
cmds:
|
|
||||||
- docker compose build agent
|
|
||||||
|
|
||||||
docker-up:
|
|
||||||
desc: Start the optional external NATS service via docker compose
|
|
||||||
cmds:
|
|
||||||
- docker compose up -d nats
|
|
||||||
|
|
||||||
docker-down:
|
|
||||||
desc: Stop the docker compose stack
|
|
||||||
cmds:
|
|
||||||
- docker compose down
|
|
||||||
|
|
||||||
docker-logs:
|
|
||||||
desc: Follow the NATS container logs
|
|
||||||
cmds:
|
|
||||||
- docker compose logs -f nats
|
|
||||||
+1
-1
@@ -75,7 +75,7 @@ services:
|
|||||||
# "Started", which reads like a crash loop. Naming the service explicitly
|
# "Started", which reads like a crash loop. Naming the service explicitly
|
||||||
# still works without activating the profile:
|
# still works without activating the profile:
|
||||||
#
|
#
|
||||||
# docker compose build agent (also: task docker-build)
|
# docker compose build agent
|
||||||
# docker compose pull agent -- plain `pull` skips profiled services
|
# docker compose pull agent -- plain `pull` skips profiled services
|
||||||
#
|
#
|
||||||
# Routine freshness is handled by the daemon, which pulls this image per
|
# Routine freshness is handled by the daemon, which pulls this image per
|
||||||
|
|||||||
Reference in new issue
Block a user