spb/datacenterindex
Public
HTML 53.9%
TypeScript 44.5%
JavaScript 0.6%
SQL 0.5%
1#!/usr/bin/env bash2# build.sh [data|crawl] [--no-sync] [--pull] [services…]3# rsync the repo to the target host and `docker compose build` there (images are built where they run;4# the pnpm store / Next cache are BuildKit cache mounts on the host, so rebuilds are incremental).5source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"67target="${1:-data}"; shift || true8check_target "$target"9sync=1; pull=""; services=()10for a in "$@"; do11 case "$a" in12 --no-sync) sync=0 ;;13 --pull) pull="--pull" ;;14 *) services+=("$a") ;;15 esac16done1718[[ $sync == 1 ]] && { ensure_remote_layout "$target"; sync_repo "$target"; }19log "docker compose build ($target: $(host_for "$target")) ${services[*]:-all}"20compose "$target" "build $pull ${services[*]:-}"21ok "built"22compose "$target" "images"23