2020-06-22 15:17:42 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
err_report() {
|
|
|
|
echo "Error on line $1"
|
|
|
|
}
|
|
|
|
|
|
|
|
trap 'err_report $LINENO' ERR
|
|
|
|
|
2020-06-23 13:20:47 +00:00
|
|
|
TAG=$1
|
2020-06-22 15:17:42 +00:00
|
|
|
|
|
|
|
# Validate required arguments
|
2020-06-23 13:20:47 +00:00
|
|
|
if [ -z "$TAG" ]
|
2020-06-22 15:17:42 +00:00
|
|
|
then
|
2020-06-23 13:20:47 +00:00
|
|
|
echo -e "Please provide a tag for the build. For example: \`./build.sh v3\`"
|
2020-06-22 15:17:42 +00:00
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2020-06-23 13:20:47 +00:00
|
|
|
dir="$(dirname "$0")"
|
2020-06-22 15:17:42 +00:00
|
|
|
|
2020-06-23 13:20:47 +00:00
|
|
|
docker build -t "iptestground/oni-buildbase:$TAG" -f "$dir/Dockerfile.oni-buildbase" "$dir"
|
|
|
|
docker build -t "iptestground/oni-runtime:$TAG" -f "$dir/Dockerfile.oni-runtime" "$dir"
|