@@ -200,7 +200,7 @@ if (NBL_WITH_DOCKER)
200
200
message (FATAL_ERROR "NBL_WITH_DOCKER works only with Windows machines. Please disable this option" )
201
201
endif ()
202
202
203
- find_program (DOCKER_EXECUTABLE docker )
203
+ find_program (DOCKER_EXECUTABLE docker REQUIRED )
204
204
205
205
if (DOCKER_EXECUTABLE )
206
206
message (STATUS "Found docker executable: ${DOCKER_EXECUTABLE} " )
@@ -216,31 +216,21 @@ if (NBL_WITH_DOCKER)
216
216
message (FATAL_ERROR "Docker installer exited with non-zero return code" )
217
217
endif ()
218
218
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 ()
229
219
230
220
# check if the docker daemon is running
231
221
# DDT stands for Docker Daemon Test
232
222
set (DDT_MAX_ATTEMPTS 10 )
233
223
set (DDT_DOCKER_RESPONDING False )
234
224
foreach (ATTEMPT RANGE 1 ${DDT_MAX_ATTEMPTS} )
235
225
message (STATUS "Attempt ${ATTEMPT} of ${DDT_MAX_ATTEMPTS} : Checking Docker Endpoint" )
236
- calldocker (info )
226
+ NBL_DOCKER (info )
237
227
238
228
if (DOCKER_EXIT_CODE EQUAL 0 )
239
229
set (DDT_DOCKER_RESPONDING True )
240
230
break ()
241
231
endif ()
242
232
243
- wait5sec ( )
233
+ NBL_WAIT_FOR ( 5 )
244
234
endforeach ()
245
235
246
236
if (NOT DDT_DOCKER_RESPONDING )
@@ -249,10 +239,12 @@ if (NBL_WITH_DOCKER)
249
239
250
240
set (DNT_NETWORK_NAME "docker_default" )
251
241
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} )
253
243
if (NOT DOCKER_EXIT_CODE EQUAL 0 )
254
244
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" )
256
248
endif ()
257
249
endif ()
258
250
0 commit comments