mirror of https://github.com/zulip/zulip.git
zulip_tools.py: Add `get_environment()` function.
This function can be used to determine the environment in which a script is being executed.
This commit is contained in:
parent
4825b6e5ad
commit
931e4752aa
|
@ -147,3 +147,11 @@ def log_management_command(cmd, log_path):
|
|||
logger.setLevel(logging.INFO)
|
||||
|
||||
logger.info("Ran '%s'" % (cmd,))
|
||||
|
||||
def get_environment():
|
||||
# type: () -> Text
|
||||
if os.path.exists(DEPLOYMENTS_DIR):
|
||||
return "prod"
|
||||
if os.environ.get("TRAVIS"):
|
||||
return "travis"
|
||||
return "dev"
|
||||
|
|
Loading…
Reference in New Issue