Skip to content
Snippets Groups Projects
Commit 40472dbd authored by Jan David Mol's avatar Jan David Mol
Browse files

Task 9048: Added comments

parent 1e106d3f
No related branches found
No related tags found
No related merge requests found
...@@ -5,20 +5,32 @@ lofar_package(Docker 1.0) ...@@ -5,20 +5,32 @@ lofar_package(Docker 1.0)
include(LofarFindPackage) include(LofarFindPackage)
lofar_find_package(Subversion REQUIRED) lofar_find_package(Subversion REQUIRED)
# Create our template engine, using build-specific info #
configure_file( # For given directories, we generate the Dockerfile
${CMAKE_CURRENT_SOURCE_DIR}/template.in # by parsing their Dockerfile.tmpl through "template".
${CMAKE_CURRENT_BINARY_DIR}/template @ONLY) #
# "template" is a script that fills in variables with
# respect to the build info (branch name, build time, etc)
#
# Directories with Dockerfile.tmpl to parse # Directories with Dockerfile.tmpl to parse
set(DOCKER_TEMPLATE_DIRS set(DOCKER_TEMPLATE_DIRS
lofar-pipeline lofar-pipeline
lofar-outputproc) lofar-outputproc)
# Create our template engine, using build-specific info
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/template.in
${CMAKE_CURRENT_BINARY_DIR}/template @ONLY)
# Convert Dockerfile.tmpl -> Dockerfile in ${DOCKER_TEMPLATE_DIRS} # Convert Dockerfile.tmpl -> Dockerfile in ${DOCKER_TEMPLATE_DIRS}
foreach(_dir ${DOCKER_TEMPLATE_DIRS}) foreach(_dir ${DOCKER_TEMPLATE_DIRS})
# _src -> _dst
set(_src ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}/Dockerfile.tmpl) set(_src ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}/Dockerfile.tmpl)
set(_dst ${CMAKE_CURRENT_BINARY_DIR}/${_dir}_Dockerfile) set(_dst ${CMAKE_CURRENT_BINARY_DIR}/${_dir}_Dockerfile)
# add generating command, and (any) target to force the generation
# when "all" is build.
add_custom_command( add_custom_command(
OUTPUT ${_dst} OUTPUT ${_dst}
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/template < ${_src} > ${_dst} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/template < ${_src} > ${_dst}
...@@ -26,6 +38,7 @@ foreach(_dir ${DOCKER_TEMPLATE_DIRS}) ...@@ -26,6 +38,7 @@ foreach(_dir ${DOCKER_TEMPLATE_DIRS})
) )
add_custom_target(${_dir}_Dockerfile_target ALL DEPENDS ${_dst}) add_custom_target(${_dir}_Dockerfile_target ALL DEPENDS ${_dst})
# install resulting Dockerfile
install(FILES install(FILES
${_dst} ${_dst}
DESTINATION share/docker/${_dir} DESTINATION share/docker/${_dir}
...@@ -33,10 +46,11 @@ foreach(_dir ${DOCKER_TEMPLATE_DIRS}) ...@@ -33,10 +46,11 @@ foreach(_dir ${DOCKER_TEMPLATE_DIRS})
) )
endforeach() endforeach()
# Install everything # Install everything else
install(DIRECTORY install(DIRECTORY
lofar-base lofar-base
lofar-pipeline lofar-pipeline
lofar-outputproc lofar-outputproc
DESTINATION share/docker DESTINATION share/docker
PATTERN Dockerfile.tmpl EXCLUDE) PATTERN Dockerfile.tmpl EXCLUDE)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment