1 #!/bin/sh2 # 07_release: copy the two binaries that an operator installs.3 #4 # Section 21.3: a release holds `inf3r-web` and `inf3r`. The version is the5 # argument, so the directory that a release made is the directory a second run6 # finds and the same one that install.sh copies from. CI has no argument and7 # uses `0.0.0-ci`; a release run passes its own version.8 set -eu9 10 version=${1:-0.0.0-ci}11 root=$(cd "$(dirname "$0")/../../.." && pwd)12 target=${CARGO_TARGET_DIR:-$root/target}13 out="$root/releases/build/$version"14 15 rustflags=${RUSTFLAGS:-}16 rustflags="$rustflags --remap-path-prefix=$root=/src"17 rustflags="$rustflags --remap-path-prefix=${CARGO_HOME:-$HOME/.cargo}=/cargo"18 rustflags="$rustflags --remap-path-prefix=${RUSTUP_HOME:-$HOME/.rustup}=/rustup"19 RUSTFLAGS=$rustflags cargo build --release --workspace20 21 for binary in inf3r-web inf3r inf3r-probe; do22 if [ ! -x "$target/release/$binary" ]; then23 printf '07_release: no release binary %s\n' "$binary" >&224 exit 125 fi26 done27 28 mkdir -p "$out"29 cp "$target/release/inf3r-web" "$out/"30 cp "$target/release/inf3r" "$out/"31 cp "$target/release/inf3r-probe" "$out/"32 cp "$root/ops/inf3r-web.service" "$out/"33 cp "$root/ops/install.sh" "$out/"34 cp "$root/LICENSE" "$root/NOTICE" "$root/README.md" "$root/SOURCE" "$out/"35 36 printf '%s\n' "$out"