Skip to content

Commit cea9bca

Browse files
committed
docker: Remove build and run script, and use Makefile instead
1 parent bcbceaf commit cea9bca

File tree

7 files changed

+59
-69
lines changed

7 files changed

+59
-69
lines changed

test/Docker-ITK-v4.10.1_USE_SYSTEM_LIBRARIES-OFF/build.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/Docker-ITK-v4.10.1_USE_SYSTEM_LIBRARIES-OFF/run.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/Docker-ITK-v4.8.0_USE_SYSTEM_LIBRARIES-OFF/build.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/Docker-ITK-v4.8.0_USE_SYSTEM_LIBRARIES-OFF/run.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/Docker/Makefile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#
2+
# Parameters
3+
#
4+
5+
# Name of the docker executable
6+
DOCKER = docker
7+
8+
# DockerHub organization and repository to pull the images from
9+
ORG = slicer
10+
REPO = slicerexecutionmodel
11+
12+
DIRECTORIES = Docker-ITK-v4.10.1_USE_SYSTEM_LIBRARIES-OFF Docker-ITK-v4.8.0_USE_SYSTEM_LIBRARIES-OFF
13+
14+
# On CircleCI, do not attempt to delete container
15+
# See https://circleci.com/docs/docker-btrfs-error/
16+
RM = --rm
17+
ifeq ("$(CIRCLECI)", "true")
18+
RM =
19+
endif
20+
21+
#
22+
# images: This target builds all IMAGES (because it is the first one, it is built by default)
23+
#
24+
images: $(DIRECTORIES)
25+
26+
#
27+
# display
28+
#
29+
display_images:
30+
for directory in $(DIRECTORIES); do echo $$directory | rev | cut -d'/' -f 1 | rev | cut -d'-' -f 2- | tr '[:upper:]' '[:lower:]'; done
31+
32+
$(VERBOSE).SILENT: display_images
33+
34+
#
35+
# build implicit rule
36+
#
37+
$(DIRECTORIES): %: ../%/Dockerfile
38+
$(eval DIR := $(basename $@))
39+
$(eval TAG := $(shell echo $(DIR) | rev | cut -d'/' -f 1 | rev | cut -d'-' -f 2- | tr '[:upper:]' '[:lower:]'))
40+
$(eval IMAGEID := $(shell $(DOCKER) images -q $(ORG)/$(REPO):$(TAG)))
41+
$(DOCKER) build -t $(ORG)/$(REPO):$(TAG) \
42+
--build-arg IMAGE=$(ORG)/$(REPO):$(TAG) \
43+
--build-arg VCS_REF=`git rev-parse --short HEAD` \
44+
--build-arg VCS_URL=`git config --get remote.origin.url` \
45+
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
46+
../$@
47+
if [ -n "$(IMAGEID)" ]; then $(DOCKER) rmi "$(IMAGEID)"; fi
48+
49+
#
50+
# run implicit rule
51+
#
52+
.SECONDEXPANSION:
53+
$(addsuffix .run,$(DIRECTORIES)):
54+
$(eval DIR := $(basename $@))
55+
$(eval TAG := $(shell echo $(DIR) | rev | cut -d'/' -f 1 | rev | cut -d'-' -f 2- | tr '[:upper:]' '[:lower:]'))
56+
$(DOCKER) run -v $$(pwd)/../..:/usr/src/SlicerExecutionModel -ti $(RM) $(ORG)/$(REPO):$(TAG) bash
57+
58+
59+
.PHONY: images display_images $(DIRECTORIES) $(addsuffix .run,$(DIRECTORIES))

test/Docker/build.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

test/Docker/run.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)