diff --git a/build.bash b/build.bash new file mode 100755 index 0000000..df22141 --- /dev/null +++ b/build.bash @@ -0,0 +1,34 @@ +#!/bin/bash +set -exo pipefail + +I2SRC="$1" + +if [ -z "$I2SRC" ]; then + cat <&2 +Usage: ${0} /icinga2/source/dir +EOF + + false +fi + +I2SRC="$(realpath "$I2SRC")" +BLDCTX="$(realpath "$(dirname "$0")")" + +docker build -f "${BLDCTX}/action-base.Dockerfile" -t icinga/icinga2-builder "$BLDCTX" +docker build -f "${BLDCTX}/deps.Dockerfile" -t icinga/icinga2-deps "$BLDCTX" + +docker run --rm -i \ + -v "${I2SRC}:/i2src:ro" \ + -v "${BLDCTX}:/bldctx:ro" \ + -v "$(printf %s ~/.ccache):/root/.ccache" \ + -v /var/run/docker.sock:/var/run/docker.sock \ + icinga/icinga2-builder bash <