Merge fix/ci-explicit-product-name: avoid CI image/cache collisions across products
This commit is contained in:
commit
620c5a1317
1 changed files with 13 additions and 7 deletions
20
ci/build.sh
20
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 <product-repo-root> <cargo-command...>
|
||||
# e.g. ci/build.sh /path/to/breadpad cargo build --release --locked
|
||||
# Usage: ci/build.sh <product-name> <product-repo-root> <cargo-command...>
|
||||
# e.g. ci/build.sh breadpad /path/to/breadpad cargo build --release --locked
|
||||
#
|
||||
# <product-name> is used verbatim as the image tag and cache-volume name —
|
||||
# it must be passed explicitly rather than derived from <product-repo-root>'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 <product-repo-root>/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 <product-repo-root> <cargo-command...>" >&2
|
||||
if [ $# -lt 3 ]; then
|
||||
echo "usage: build.sh <product-name> <product-repo-root> <cargo-command...>" >&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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue