#!/usr/bin/env python
import argparse
import os
import json
import subprocess

parser = argparse.ArgumentParser(description="Runs db-migrate on a linked database")
parser.add_argument("--database", help="The name of the database to migrate", required = True)
parser.add_argument("--user", help="The username to log in as", required = True)
parser.add_argument("--password", help="The password to use", required = True)

args = parser.parse_args()

config = {
    "dev": {
      "driver": "pg",
      "host": os.environ["DB_PORT_5432_TCP_ADDR"],
      "port": os.environ["DB_PORT_5432_TCP_PORT"],
      "database": args.database,
      "user": args.user,
      "password": args.password,
      }
    }

print(json.dumps(config))
