allow specifying the service as env var (#3899)
* allow specifying the service as env var This is required if running as a Github Action which doesn't allow passing parameters to `docker create` but allows environment variables * import os * Update server.py
This commit is contained in:
parent
e5b3f4181d
commit
a268aae540
@ -3,6 +3,7 @@ from __future__ import unicode_literals
|
|||||||
import argparse
|
import argparse
|
||||||
import io
|
import io
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
@ -262,7 +263,7 @@ def main(argv=sys.argv[1:]):
|
|||||||
"service",
|
"service",
|
||||||
type=str,
|
type=str,
|
||||||
nargs="?", # http://stackoverflow.com/a/4480202/731592
|
nargs="?", # http://stackoverflow.com/a/4480202/731592
|
||||||
default=None,
|
default=os.environ.get("MOTO_SERVICE"),
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-H", "--host", type=str, help="Which host to bind", default="127.0.0.1"
|
"-H", "--host", type=str, help="Which host to bind", default="127.0.0.1"
|
||||||
|
Loading…
Reference in New Issue
Block a user