forked from Azure/device-simulation-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.cmd
41 lines (32 loc) · 985 Bytes
/
run.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@ECHO off & setlocal enableextensions enabledelayedexpansion
:: Note: use lowercase names for the Docker images
SET DOCKER_IMAGE="azureiotpcs/device-simulation-dotnet"
:: strlen("\scripts\docker\") => 16
SET APP_HOME=%~dp0
SET APP_HOME=%APP_HOME:~0,-16%
cd %APP_HOME%
:: Check dependencies
docker version > NUL 2>&1
IF %ERRORLEVEL% NEQ 0 GOTO MISSING_DOCKER
:: Check settings
call .\scripts\env-vars-check.cmd
IF %ERRORLEVEL% NEQ 0 GOTO FAIL
:: Start the application
echo Starting Device Simulation ...
docker run -it -p 9003:9003 ^
-e PCS_IOTHUB_CONNSTRING ^
-e PCS_STORAGEADAPTER_WEBSERVICE_URL ^
%DOCKER_IMAGE%:testing
:: - - - - - - - - - - - - - -
goto :END
:FAIL
echo Command failed
endlocal
exit /B 1
:MISSING_DOCKER
echo ERROR: 'docker' command not found.
echo Install Docker and make sure the 'docker' command is in the PATH.
echo Docker installation: https://www.docker.com/community-edition#/download
exit /B 1
:END
endlocal