|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Copyright (c) 2024 Carnegie Mellon University, IBM Corporation, and others |
| 4 | +# |
| 5 | +# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | +# of this software and associated documentation files (the "Software"), to deal |
| 7 | +# in the Software without restriction, including without limitation the rights |
| 8 | +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 9 | +# copies of the Software, and to permit persons to whom the Software is |
| 10 | +# furnished to do so, subject to the following conditions: |
| 11 | +# |
| 12 | +# The above copyright notice and this permission notice shall be included in |
| 13 | +# all copies or substantial portions of the Software. |
| 14 | +# |
| 15 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 | +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 21 | +# THE SOFTWARE. |
| 22 | + |
| 23 | +## termination hook |
| 24 | +trap ctrl_c INT QUIT TERM |
| 25 | + |
| 26 | +function ctrl_c() { |
| 27 | + exit |
| 28 | +} |
| 29 | + |
| 30 | +source ./cabot-common/build-utils.sh |
| 31 | + |
| 32 | +function help { |
| 33 | + echo "Usage: $0 [<option>] [<targets>]" |
| 34 | + echo "" |
| 35 | + echo "-h show this help" |
| 36 | + echo "-d debug build" |
| 37 | + |
| 38 | + echo "Available services:" |
| 39 | + show_available_services dcfiles |
| 40 | +} |
| 41 | + |
| 42 | +debug_build=0 |
| 43 | +dcfiles=("docker-compose.yaml") |
| 44 | + |
| 45 | +while getopts "hd" arg; do |
| 46 | + case $arg in |
| 47 | + h) |
| 48 | + help |
| 49 | + exit |
| 50 | + ;; |
| 51 | + d) |
| 52 | + debug_build=1 |
| 53 | + ;; |
| 54 | + esac |
| 55 | +done |
| 56 | +shift $((OPTIND-1)) |
| 57 | +targets=$@ |
| 58 | + |
| 59 | +scriptdir=$(dirname $0) |
| 60 | +cd $scriptdir |
| 61 | +scriptdir=$(pwd) |
| 62 | + |
| 63 | +build_workspace dcfiles targets debug_build |
| 64 | +if [ $? != 0 ]; then exit 1; fi |
0 commit comments