Skip to content

Commit 03aa338

Browse files
committed
ENH: Add Docker Test file
This commit add a Docker file allowing to easily build and test the project. It contains the recipe allowing to build ITK so that SlicerExecutionModel can quickly be configured, built and tested.
1 parent 419d5a6 commit 03aa338

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed

test/Docker/Dockerfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FROM debian:8
2+
MAINTAINER Insight Software Consortium <community@itk.org>
3+
4+
RUN apt-get update && apt-get install -y \
5+
build-essential \
6+
curl \
7+
cmake \
8+
git \
9+
libexpat1-dev \
10+
libhdf5-dev \
11+
libjpeg-dev \
12+
libpng12-dev \
13+
libpython3-dev \
14+
libtiff5-dev \
15+
python \
16+
ninja-build \
17+
wget \
18+
vim \
19+
zlib1g-dev
20+
21+
RUN mkdir -p /usr/src/SlicerExecutionModel-build
22+
WORKDIR /usr/src
23+
24+
# 2015-09-24
25+
ENV ITK_GIT_TAG cf05d9658da5f27c3ad6652028f563b50cf194b2
26+
RUN git clone git://itk.org/ITK.git && \
27+
cd ITK && \
28+
git checkout ${ITK_GIT_TAG} && \
29+
cd ../ && \
30+
mkdir ITK-build && \
31+
cd ITK-build && \
32+
cmake \
33+
-G Ninja \
34+
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
35+
-DBUILD_EXAMPLES:BOOL=OFF \
36+
-DBUILD_TESTING:BOOL=OFF \
37+
-DBUILD_SHARED_LIBS:BOOL=ON \
38+
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON \
39+
-DITK_LEGACY_REMOVE:BOOL=ON \
40+
-DITK_BUILD_DEFAULT_MODULES:BOOL=OFF \
41+
-DITK_USE_SYSTEM_LIBRARIES:BOOL=ON \
42+
-DModule_ITKCommon:BOOL=ON \
43+
-DModule_ITKIOXML:BOOL=ON \
44+
../ITK && \
45+
ninja install && \
46+
rm -rf ITK ITK-build
47+

test/Docker/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
script_dir="`cd $(dirname $0); pwd`"
4+
5+
docker build -t slicer/slicerexecutionmodel $script_dir

test/Docker/run.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
script_dir="`cd $(dirname $0); pwd`"
4+
5+
docker run \
6+
--rm \
7+
-v $script_dir/../..:/usr/src/SlicerExecutionModel \
8+
slicer/slicerexecutionmodel \
9+
/usr/src/SlicerExecutionModel/test/Docker/test.sh

test/Docker/test.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# This is a script to build the project and run the test suite in the base
4+
# Docker container.
5+
6+
die() {
7+
echo "Error: $@" 1>&2
8+
exit 1;
9+
}
10+
11+
cd /usr/src/SlicerExecutionModel-build || die "Could not cd into the build directory"
12+
13+
cmake \
14+
-G Ninja \
15+
-DCMAKE_BUILD_TYPE:STRING=Release \
16+
/usr/src/SlicerExecutionModel || die "CMake configuration failed"
17+
ctest -VV -D Experimental || die "ctest failed"

0 commit comments

Comments
 (0)