Change environment variable setup
All checks were successful
/ checks (pull_request) Successful in 15s
All checks were successful
/ checks (pull_request) Successful in 15s
This commit is contained in:
parent
d6bce1b39d
commit
77ae214d24
23 changed files with 113 additions and 122 deletions
|
@ -7,8 +7,8 @@ import importlib
|
|||
import buildbot.plugins
|
||||
|
||||
|
||||
def _get_auth_config(devops_env_id: str):
|
||||
if devops_env_id == "LOCAL":
|
||||
def _get_auth_config(ENVIRONMENT: str):
|
||||
if ENVIRONMENT == "LOCAL":
|
||||
import conf.local.auth
|
||||
|
||||
importlib.reload(conf.local.auth)
|
||||
|
@ -20,13 +20,13 @@ def _get_auth_config(devops_env_id: str):
|
|||
return conf.production.auth
|
||||
|
||||
|
||||
def fetch_authentication(devops_env_id: str):
|
||||
auth_config = _get_auth_config(devops_env_id)
|
||||
return auth_config.get_authentication(devops_env_id)
|
||||
def fetch_authentication(ENVIRONMENT: str):
|
||||
auth_config = _get_auth_config(ENVIRONMENT)
|
||||
return auth_config.get_authentication(ENVIRONMENT)
|
||||
|
||||
|
||||
def fetch_authorization(devops_env_id: str):
|
||||
auth_config = _get_auth_config(devops_env_id)
|
||||
def fetch_authorization(ENVIRONMENT: str):
|
||||
auth_config = _get_auth_config(ENVIRONMENT)
|
||||
|
||||
admin_usernames = auth_config.admin_usernames
|
||||
deploy_dev_usernames = auth_config.deploy_dev_usernames
|
||||
|
|
|
@ -20,7 +20,7 @@ trusted_dev_usernames = [
|
|||
]
|
||||
|
||||
|
||||
def get_authentication(devops_env_id: str):
|
||||
def get_authentication(ENVIRONMENT: str):
|
||||
class LocalEnvAuth(buildbot.plugins.util.CustomAuth):
|
||||
def check_credentials(self, user, password):
|
||||
return user.decode() == "admin" and password.decode() == "admin"
|
||||
|
|
|
@ -27,5 +27,5 @@ def get_worker_password(worker_name: str) -> str:
|
|||
return "localhost"
|
||||
|
||||
|
||||
def get_worker_names(devops_env_id: str):
|
||||
def get_worker_names(ENVIRONMENT: str):
|
||||
return _worker_names
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
import importlib
|
||||
|
||||
|
||||
def _get_config(devops_env_id: str):
|
||||
if devops_env_id == "LOCAL":
|
||||
def _get_config(ENVIRONMENT: str):
|
||||
if ENVIRONMENT == "LOCAL":
|
||||
import conf.local.machines
|
||||
|
||||
importlib.reload(conf.local.machines)
|
||||
|
@ -18,13 +18,13 @@ def _get_config(devops_env_id: str):
|
|||
return conf.production.machines
|
||||
|
||||
|
||||
def fetch_platform_worker_names(devops_env_id: str):
|
||||
machines_config = _get_config(devops_env_id)
|
||||
return machines_config.get_worker_names(devops_env_id)
|
||||
def fetch_platform_worker_names(ENVIRONMENT: str):
|
||||
machines_config = _get_config(ENVIRONMENT)
|
||||
return machines_config.get_worker_names(ENVIRONMENT)
|
||||
|
||||
|
||||
def get_worker_password(devops_env_id: str, worker_name: str) -> str:
|
||||
machines_config = _get_config(devops_env_id)
|
||||
def get_worker_password(ENVIRONMENT: str, worker_name: str) -> str:
|
||||
machines_config = _get_config(ENVIRONMENT)
|
||||
return machines_config.get_worker_password(worker_name)
|
||||
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ import importlib
|
|||
from typing import Any
|
||||
|
||||
|
||||
def get_config(devops_env_id: str) -> Any:
|
||||
if devops_env_id == "LOCAL":
|
||||
def get_config(ENVIRONMENT: str) -> Any:
|
||||
if ENVIRONMENT == "LOCAL":
|
||||
import conf.local.worker
|
||||
|
||||
importlib.reload(conf.local.worker)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue