secrets-tool command for bootstrapping database.

This additional secrets-tool command can be used to run the database
bootsrapping script (`script/database_setup.py`) inside an ATAT docker
container against the Azure database. It sources the necessary keys from
Key Vault.
This commit is contained in:
dandds
2020-01-23 15:35:35 -05:00
parent 49a1a219ae
commit a8f6befc17
6 changed files with 185 additions and 13 deletions

View File

@@ -7,6 +7,7 @@ import logging
from commands.secrets import secrets
from commands.terraform import terraform
from commands.database import database
config.setup_logging()
logger = logging.getLogger(__name__)
@@ -21,6 +22,7 @@ def cli():
# Add additional command groups
cli.add_command(secrets)
cli.add_command(terraform)
cli.add_command(database)
if __name__ == "__main__":
@@ -41,12 +43,12 @@ if __name__ == "__main__":
val = keyvault.get_secret(secret)
#print(val)
os.environ[name] = val
env = os.environ.copy()
env = os.environ.copy()
command = "{} {}".format(PROCESS, sys.argv[1])
with subprocess.Popen(command, env=env, stdout=subprocess.PIPE, shell=True) as proc:
for line in proc.stdout:
logging.info(line.decode("utf-8") )
except Exception as e:
print(e, traceback.print_stack)
'''
'''