mirror of
https://github.com/hanzoai/compute.git
synced 2026-10-30 14:50:41 +00:00
Cloud's side of this rename landed some time ago — the app is apps/compute, the env is COMPUTE_URL — and left a note saying the other half moves with the manifest that names it. This is the half that does not touch the cluster: the Go module is github.com/hanzoai/compute, the binary it builds is compute, and the image is ghcr.io/hanzoai/compute. GitHub already carries the new name. What is deliberately NOT here is the cutover. The Service universe declares is still visor, and so are visor-config, visor-kms-sync and visor-db-bucket. Pointing anything at compute.hanzo.svc before those move resolves to nothing, so they move together, in universe, not here.
22 lines
1.0 KiB
Bash
22 lines
1.0 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
# Private Hanzo modules (e.g. github.com/hanzoai/commerce/metering) live in
|
|
# private repos; go-mod's direct git fetch is authenticated with the BuildKit
|
|
# BuildKit secret gh_token, mounted at /run/secrets/gh_token by the Dockerfile
|
|
# (RUN --mount=type=secret,id=gh_token). GOPRIVATE routes those modules
|
|
# direct-to-git (never through a public proxy).
|
|
export GOPRIVATE="github.com/hanzoai/*,github.com/zooai/*,github.com/parsdao/*"
|
|
if [ -f /run/secrets/gh_token ]; then
|
|
export GIT_CONFIG_COUNT=1 \
|
|
GIT_CONFIG_KEY_0="url.https://x-access-token:$(cat /run/secrets/gh_token)@github.com/.insteadOf" \
|
|
GIT_CONFIG_VALUE_0="https://github.com/"
|
|
fi
|
|
export GOPROXY="${GOPROXY:-https://proxy.golang.org,direct}"
|
|
|
|
# GOTOOLCHAIN is set by the Dockerfile (ENV GOTOOLCHAIN=auto in the BACK stage),
|
|
# which is where every other Hanzo Go builder sets it. Outside a container Go
|
|
# already defaults to auto, so this script needs no export of its own.
|
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH:-amd64} go build -ldflags="-w -s" -o compute .
|