mirror of
https://github.com/Icinga/docker-icinga2.git
synced 2026-05-05 10:56:12 +02:00
Add build.bash
This commit is contained in:
parent
2231c2c7f8
commit
82c4a099d1
34
build.bash
Executable file
34
build.bash
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
set -exo pipefail
|
||||
|
||||
I2SRC="$1"
|
||||
|
||||
if [ -z "$I2SRC" ]; then
|
||||
cat <<EOF >&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 <<EOF
|
||||
set -exo pipefail
|
||||
|
||||
git -C /i2src archive --prefix=i2cp/ HEAD |tar -xC /
|
||||
cp -r /i2src/.git /i2cp
|
||||
cd /i2cp
|
||||
|
||||
/bldctx/compile.bash
|
||||
docker build -f /bldctx/Dockerfile -t icinga/icinga2 .
|
||||
EOF
|
||||
Loading…
x
Reference in New Issue
Block a user