Add scripts to build a dev environment with Docker.

Fixes #5996
This commit is contained in:
Gunnar Beutner 2014-04-11 11:01:38 +02:00
parent 8d3a334183
commit 1f8a1a9e1a
6 changed files with 30 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
.vagrant
build
icinga-version.h.fallback
*.komodoproject

2
dev/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.build
config

4
dev/README Normal file
View File

@ -0,0 +1,4 @@
Icinga 2 Development Environment
================================
The `build' script in this directory builds Icinga 2 in a Docker VM.

6
dev/docker/Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM debian:jessie
RUN apt-get update
RUN apt-get install -y clang cmake make ccache flex bison libboost-all-dev libssl-dev git-core cgdb
RUN mkdir /root/build
ADD build /root/build
ENV HOME /root

11
dev/docker/build Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
cd $(dirname -- $0)/icinga2-build || exit 1
CCACHE_SLOPPINESS="include_file_mtime"
export CCACHE_SLOPPINESS
if [ ! -e CMakeCache.txt ]; then
CC="ccache clang" CXX="ccache clang++" cmake ../icinga2 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/icinga2 -DCMAKE_INSTALL_SYSCONFDIR=/root/icinga2-config
fi
make -j 4 && make install && cgdb -ex r --args /opt/icinga2/sbin/icinga2 -c /root/icinga2-config/icinga2/icinga2.conf -DUseVfork=0

7
dev/run Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
cd `dirname -- $0`
DIR=`pwd`
cd docker
docker.io build -t icinga2 --rm .
docker.io run -v $DIR/..:/root/icinga2 -v $DIR/.build:/root/icinga2-build -v $HOME/.ccache:/root/.ccache -v $DIR/config:/root/icinga2-config -t -i icinga2 /root/build