Files
archie/tools/cloud-setup.sh
T
sam ec9bf5feb2 docs: track work in Gitea issues instead of beads
Every one of the 1709 tracker issues was created in Gitea and checked field by
field against its source record: title, body, state, label set, assignee,
comments, dependency edges and epic label. All 1729 beads are closed, citing the
issue that carries each one, and .beads is removed.

Three differences are deliberate: Gitea truncates titles at 253 characters, so
three long titles keep their full text in the issue body; Gitea refuses a mutual
dependency, so five symmetric relates-to links exist in one direction; issue 497
carries its fix from e3b1103f.
2026-10-29 23:22:35 +11:00

81 lines
2.9 KiB
Bash
Executable File

#!/usr/bin/env bash
# Claude Code cloud environment setup for archie-core. Standalone: runs before
# or without a checkout, so pins mirror go.mod, .golangci-version,
# tools/proto.sh and .github/workflows/quality.yml. Bump them together.
set -euo pipefail
GO_VERSION=1.27.2
NODE_MAJOR=24
TASK_VERSION=v3.48.0
GOLANGCI_VERSION=v2.14.0
GOFUMPT_VERSION=v0.11.0
BUF_VERSION=v1.71.0
PROTOC_GEN_GO_VERSION=v1.36.11
PROTOC_GEN_GO_GRPC_VERSION=v1.6.2
SUDO=
[ "$(id -u)" -eq 0 ] || SUDO=sudo
export DEBIAN_FRONTEND=noninteractive
$SUDO apt-get update
$SUDO apt-get install -y --no-install-recommends \
ca-certificates curl git build-essential ripgrep
if ! go version 2>/dev/null | grep -q "go$GO_VERSION "; then
arch=$(dpkg --print-architecture)
curl -fsSL "https://go.dev/dl/go$GO_VERSION.linux-$arch.tar.gz" -o /tmp/go.tgz
$SUDO rm -rf /usr/local/go
$SUDO tar -C /usr/local -xzf /tmp/go.tgz
rm /tmp/go.tgz
fi
export PATH="/usr/local/go/bin:$HOME/go/bin:$PATH"
GOBIN="$(go env GOPATH)/bin"
export GOBIN
if ! node --version 2>/dev/null | grep -q "^v$NODE_MAJOR\."; then
curl -fsSL "https://deb.nodesource.com/setup_$NODE_MAJOR.x" | $SUDO bash -
$SUDO apt-get install -y nodejs
fi
go install "github.com/go-task/task/v3/cmd/task@$TASK_VERSION"
go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$GOLANGCI_VERSION"
go install "mvdan.cc/gofumpt@$GOFUMPT_VERSION"
go install "github.com/bufbuild/buf/cmd/buf@$BUF_VERSION"
go install "google.golang.org/protobuf/cmd/protoc-gen-go@$PROTOC_GEN_GO_VERSION"
go install "google.golang.org/grpc/cmd/protoc-gen-go-grpc@$PROTOC_GEN_GO_GRPC_VERSION"
# PostgreSQL 18 for e2e/stack.sh, which runs its own cluster. Never for
# tests: they use fakes.
if [ ! -x /usr/lib/postgresql/18/bin/postgres ]; then
$SUDO apt-get install -y --no-install-recommends postgresql-common
$SUDO /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
$SUDO apt-get install -y --no-install-recommends postgresql-18
fi
# Commit and PR attribution stays off, matching local settings.
mkdir -p "$HOME/.claude"
settings="$HOME/.claude/settings.json"
[ -s "$settings" ] || echo '{}' >"$settings"
node -e '
const fs = require("fs"), p = process.argv[1];
const s = JSON.parse(fs.readFileSync(p, "utf8"));
s.attribution = { ...s.attribution, commit: "", pr: "", sessionUrl: false };
fs.writeFileSync(p, JSON.stringify(s, null, 2) + "\n");
' "$settings"
# The session shell is not a login shell, so profile.d is never read. Link the
# tools onto the default PATH instead.
$SUDO ln -sf /usr/local/go/bin/* "$GOBIN"/* /usr/local/bin/
# Warm module and pnpm caches when the checkout is already present.
repo=${CLAUDE_PROJECT_DIR:-$PWD}
if [ -f "$repo/go.mod" ] && grep -q archie-core "$repo/go.mod"; then
(cd "$repo" && go mod download && go -C tools mod download)
(cd "$repo/ui" && corepack enable pnpm && pnpm install --frozen-lockfile)
fi
go version
node --version
task --version
golangci-lint --version