Skip to content

Commit 6b3b654

Browse files
committed
Add docker image test script
1 parent b292de7 commit 6b3b654

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

docker/_typical_workflow.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
set -x
4+
projectdir=$(cd $(dirname $0)/.. && pwd)
5+
6+
# make a build folder
7+
cd $(mktemp -d -t cpp11training_build)
8+
9+
# make the project
10+
cmake $projectdir/src && make
11+
12+
# run the tests
13+
./cpp11training
14+

docker/build-container.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
#!/bin/bash
22

3-
docker build --tag cpp11training $(cd $(dirname $0); pwd)
3+
cd $(cd $(dirname $0)/..; pwd)
4+
docker build --tag cpp11training docker
5+
docker/test_buildimage.sh

docker/test_buildimage.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
# script to test the build container
4+
#
5+
# it runs the typical workflow in the build container
6+
# (cf. _typical_workflow.sh)
7+
8+
project_dir=$(cd $(dirname $0)/..; pwd)
9+
10+
docker build -t xtofl/cpp11training $project_dir/docker
11+
12+
docker run --volume $(pwd):$(pwd) --workdir $(pwd) --rm ${IMAGE:-"xtofl/cpp11training"} /bin/sh docker/_typical_workflow.sh
13+

0 commit comments

Comments
 (0)