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

Task #8437: Fixed calls to docker-template and versiondocker

parent 1a323e75
No related branches found
No related tags found
No related merge requests found
......@@ -138,8 +138,8 @@ foreach(_file pipeline.cfg.CEP4)
# when "all" is build.
add_custom_command(
OUTPUT ${_dst}
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/docker-template < ${_src} > ${_dst}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/docker-template ${_src} ${CMAKE_CURRENT_BINARY_DIR}/versiondocker
COMMAND ${CMAKE_SOURCE_DIR}/Docker/docker-template -v ${CMAKE_BINARY_DIR}/Docker/versiondocker < ${_src} > ${_dst}
DEPENDS ${CMAKE_SOURCE_DIR}/Docker/docker-template ${_src} ${CMAKE_BINARY_DIR}/Docker/versiondocker
)
add_custom_target(${_file}_target ALL DEPENDS ${_dst})
......
......@@ -42,7 +42,7 @@ foreach(_dir ${DOCKER_TEMPLATE_DIRS})
# when "all" is build.
add_custom_command(
OUTPUT ${_dst}
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/docker-template < ${_src} > ${_dst}
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/docker-template -v ${CMAKE_CURRENT_BINARY_DIR}/versiondocker < ${_src} > ${_dst}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/docker-template ${_src} ${CMAKE_CURRENT_BINARY_DIR}/versiondocker
)
add_custom_target(${_dir}_Dockerfile_target ALL DEPENDS ${_dst})
......
......@@ -18,9 +18,34 @@
# ----- LOFAR_BRANCH_NAME = tags/LOFAR-Release-2_15_1 -----
# ----- LOFAR_BRANCH_NAME = UNKNOWN -----
function usage() {
echo "$0 [-v VERSIONDOCKER]"
echo ""
echo " -v VERSIONDOCKER Provides location of 'versiondocker' executable"
echo ""
exit 1
}
# Defaults
VERSION_DOCKER="versiondocker"
# Parse options
while getopts "hv:" opt; do
case $opt in
h) usage
;;
v) VERSION_DOCKER="$OPTARG"
;;
\?) error "Invalid option: -$OPTARG"
;;
:) error "Option requires an argument: -$OPTARG"
;;
esac
done
[ $OPTIND -eq 1 ] && usage
# Make sure we obtain info about the project source!
#PATH=$PATH:.
VERSION_INFO=`(versiondocker || ./versiondocker) 2>/dev/null` # in cmake, executable is in .
VERSION_INFO=`$VERSION_DOCKER`
# Extract branch name w.r.t. repository root, e.g. branches/LOFAR-Task1234
export LOFAR_BRANCH_NAME=`echo "$VERSION_INFO" | perl -ne 'print "$1" if /branch += +(.+)/;'`
......
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