@@ -200,7 +200,7 @@ if (NBL_WITH_DOCKER)
200200 message (FATAL_ERROR "NBL_WITH_DOCKER works only with Windows machines. Please disable this option" )
201201 endif ()
202202
203- find_program (DOCKER_EXECUTABLE docker)
203+ find_program (DOCKER_EXECUTABLE docker REQUIRED )
204204
205205 if (DOCKER_EXECUTABLE)
206206 message (STATUS "Found docker executable: ${DOCKER_EXECUTABLE} " )
@@ -216,31 +216,21 @@ if (NBL_WITH_DOCKER)
216216 message (FATAL_ERROR "Docker installer exited with non-zero return code" )
217217 endif ()
218218 endif ()
219-
220- # helper macro for stalling the script for 5 sec
221- macro (wait5sec)
222- execute_process (COMMAND powershell -Command "Start-Sleep -Seconds 5" )
223- endmacro ()
224-
225- # helper macro for calling docker, takes args as a string
226- macro (calldocker)
227- execute_process (COMMAND ${DOCKER_EXECUTABLE} ${ARGN} RESULT_VARIABLE DOCKER_EXIT_CODE OUTPUT_QUIET )
228- endmacro ()
229219
230220 # check if the docker daemon is running
231221 # DDT stands for Docker Daemon Test
232222 set (DDT_MAX_ATTEMPTS 10)
233223 set (DDT_DOCKER_RESPONDING False )
234224 foreach (ATTEMPT RANGE 1 ${DDT_MAX_ATTEMPTS} )
235225 message (STATUS "Attempt ${ATTEMPT} of ${DDT_MAX_ATTEMPTS} : Checking Docker Endpoint" )
236- calldocker (info)
226+ NBL_DOCKER (info)
237227
238228 if (DOCKER_EXIT_CODE EQUAL 0)
239229 set (DDT_DOCKER_RESPONDING True )
240230 break ()
241231 endif ()
242232
243- wait5sec( )
233+ NBL_WAIT_FOR(5 )
244234 endforeach ()
245235
246236 if (NOT DDT_DOCKER_RESPONDING)
@@ -249,10 +239,12 @@ if (NBL_WITH_DOCKER)
249239
250240 set (DNT_NETWORK_NAME "docker_default" )
251241 message (STATUS "Checking wether \" ${DNT_NETWORK_NAME} \" docker network exist." )
252- calldocker (network inspect ${DNT_NETWORK_NAME} )
242+ NBL_DOCKER (network inspect ${DNT_NETWORK_NAME} )
253243 if (NOT DOCKER_EXIT_CODE EQUAL 0)
254244 message (STATUS "Docker network \" ${DNT_NETWORK_NAME} \" doesn't exist. Creating one.'" )
255- calldocker(network create -d nat ${DNT_NETWORK_NAME} )
245+ NBL_DOCKER(network create -d nat ${DNT_NETWORK_NAME} )
246+ else ()
247+ message (STATUS "Docker network \" ${DNT_NETWORK_NAME} \" exists" )
256248 endif ()
257249endif ()
258250
0 commit comments