1#!/usr/bin/env bash 2set -eu 3 4usage() { echo "Usage: $0 [-c <bazelrc config>] [-f use file output]" 1>&2; exit 0; } 5[ $# -eq 0 ] && usage 6while getopts ":f:c:h" opt; do 7 case $opt in 8 f) targets_file="$OPTARG" ;; 9 c) config="--config=$OPTARG" ;; 10 h | *) usage ;; 11 esac 12done 13 14echo "Building targets:" 15bazel build "$config" --target_pattern_file="$targets_file" 16 17build_exit=$? 18exit $build_exit