d11f8b1240
FossilOrigin-Name: 1a21b01b33244f3d652dece381edfb2b3b36744ae4c0ae0fc861b882484b36a1
27 lines
580 B
Bash
Executable File
27 lines
580 B
Bash
Executable File
#!/bin/sh
|
|
set -euax
|
|
|
|
## check the usage and get the image to test
|
|
if [ $# -ne 1 ] ; then
|
|
echo 1>&2 "usage: $0 image"
|
|
exit 1
|
|
fi
|
|
image=$1
|
|
|
|
# Get the toplevel directory of the git repo
|
|
repo_dir=`git rev-parse --show-toplevel`
|
|
|
|
# See if the file for the image is available
|
|
|
|
if [ ! -f "${repo_dir}/${image}.md" ] ; then
|
|
echo 1>&2 "could not find the file for ${image}"
|
|
exit 1
|
|
fi
|
|
|
|
# Let's try to build it.
|
|
echo "attempting to build ${image} in ${repo_dir}"
|
|
${repo_dir}/scripts/tangle.tcl -R "${image}.dockerfile" "${image}.md" | \
|
|
docker build -t test:${image} -f - .
|
|
|
|
exit 0
|