Renaming cart service env vars
Renaming Cart service environment variables: CART_SERVICE_ADDR => LISTEN_ADDR CART_SERVICE_PORT => PORT
This commit is contained in:
parent
22762b28bd
commit
f06bc11dd4
2 changed files with 8 additions and 8 deletions
|
@ -11,14 +11,14 @@ namespace cartservice
|
||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
const string CART_SERVICE_ADDRESS = "CART_SERVICE_ADDR";
|
const string CART_SERVICE_ADDRESS = "LISTEN_ADDR";
|
||||||
const string REDIS_ADDRESS = "REDIS_ADDR";
|
const string REDIS_ADDRESS = "REDIS_ADDR";
|
||||||
const string CART_SERVICE_PORT = "CART_SERVICE_PORT";
|
const string CART_SERVICE_PORT = "PORT";
|
||||||
|
|
||||||
[Verb("start", HelpText = "Starts the server listening on provided port")]
|
[Verb("start", HelpText = "Starts the server listening on provided port")]
|
||||||
class ServerOptions
|
class ServerOptions
|
||||||
{
|
{
|
||||||
[Option('h', "hostname", HelpText = "The ip on which the server is running. If not provided, CART_SERVICE_ADDR environment variable value will be used. If not defined, localhost is used")]
|
[Option('h', "hostname", HelpText = "The ip on which the server is running. If not provided, LISTEN_ADDR environment variable value will be used. If not defined, localhost is used")]
|
||||||
public string Host { get; set; }
|
public string Host { get; set; }
|
||||||
|
|
||||||
[Option('p', "port", HelpText = "The port on for running the server")]
|
[Option('p', "port", HelpText = "The port on for running the server")]
|
||||||
|
|
|
@ -9,8 +9,8 @@ GOTO End1
|
||||||
:local
|
:local
|
||||||
set REDIS_PORT=6379
|
set REDIS_PORT=6379
|
||||||
set REDIS_ADDR=localhost:%REDIS_PORT%
|
set REDIS_ADDR=localhost:%REDIS_PORT%
|
||||||
set CART_SERVICE_ADDR=127.0.0.1
|
set LISTEN_ADDR=127.0.0.1
|
||||||
set CART_SERVICE_PORT=7070
|
set PORT=7070
|
||||||
|
|
||||||
echo running redis emulator locally on a separate window
|
echo running redis emulator locally on a separate window
|
||||||
taskkill /f /im "redis-server.exe"
|
taskkill /f /im "redis-server.exe"
|
||||||
|
@ -24,8 +24,8 @@ GOTO End1
|
||||||
:docker_local
|
:docker_local
|
||||||
set REDIS_PORT=6379
|
set REDIS_PORT=6379
|
||||||
set REDIS_ADDR=redis:%REDIS_PORT%
|
set REDIS_ADDR=redis:%REDIS_PORT%
|
||||||
set CART_SERVICE_ADDR=127.0.0.1
|
set LISTEN_ADDR=127.0.0.1
|
||||||
set CART_SERVICE_PORT=7070
|
set PORT=7070
|
||||||
|
|
||||||
echo run docker container with redis
|
echo run docker container with redis
|
||||||
docker run -d --name=redis -p %REDIS_PORT%:%REDIS_PORT% redis
|
docker run -d --name=redis -p %REDIS_PORT%:%REDIS_PORT% redis
|
||||||
|
@ -34,7 +34,7 @@ GOTO End1
|
||||||
docker build -t cartservice ..\.
|
docker build -t cartservice ..\.
|
||||||
|
|
||||||
echo run container image for cart service
|
echo run container image for cart service
|
||||||
docker run -it --rm -e REDIS_ADDR=%REDIS_ADDR% -e CART_SERVICE_ADDR=%CART_SERVICE_ADDR% -e CART_SERVICE_PORT=%CART_SERVICE_PORT% -p %CART_SERVICE_PORT%:%CART_SERVICE_PORT% cartservice
|
docker run -it --rm -e REDIS_ADDR=%REDIS_ADDR% -e LISTEN_ADDR=%LISTEN_ADDR% -e PORT=%PORT% -p %PORT%:%PORT% cartservice
|
||||||
|
|
||||||
GOTO End1
|
GOTO End1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue