diff --git a/ci/build.sh b/ci/build.sh index 4e3269b..6e6b8b7 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -5,8 +5,14 @@ # from ci/Containerfile, then runs the given cargo command inside it # against a product repo checkout. # -# Usage: ci/build.sh -# e.g. ci/build.sh /path/to/breadpad cargo build --release --locked +# Usage: ci/build.sh +# e.g. ci/build.sh breadpad /path/to/breadpad cargo build --release --locked +# +# is used verbatim as the image tag and cache-volume name — +# it must be passed explicitly rather than derived from 's +# basename, because every product's CI checks out into a directory literally +# named `src`, which would otherwise collide across every product sharing +# this runner (same image tag, same cargo-target cache volume). # # If /ci/deps.txt exists (one pacman package per line, # '#' comments and blank lines ignored), those packages are installed on @@ -17,16 +23,16 @@ # per-product. Both persist in named docker volumes across runs. set -euo pipefail -if [ $# -lt 2 ]; then - echo "usage: build.sh " >&2 +if [ $# -lt 3 ]; then + echo "usage: build.sh " >&2 exit 1 fi -REPO_ROOT="$(cd "$1" && pwd)" -shift +PRODUCT="$1" +REPO_ROOT="$(cd "$2" && pwd)" +shift 2 CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -PRODUCT="$(basename "$REPO_ROOT")" EXTRA_PKGS="" if [ -f "${REPO_ROOT}/ci/deps.txt" ]; then