You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

28 lines
559 B

#!/bin/bash
. lib/common
set -e
PASSWORD="$(relation-get password)"
USER="$(relation-get user)"
DBNAME="$(relation-get dbname)"
cfg_dir=$(cfg_dir_init) || exit 1
cd "$cfg_dir" || exit 1
cat <<EOF >> config.php
const DB_CONNECTION_STRING = 'pgsql:host=$TARGET_SERVICE_NAME;dbname=$DBNAME;port=5432';
const DB_DRIVER = 'pdo_pgsql';
const DB_NAME = '$DBNAME';
const DB_HOST = '$TARGET_SERVICE_NAME';
const DB_PORT = '5432';
const DB_USER= '$USER';
const DB_PASSWORD = '$PASSWORD';
const TABLENAME_PREFIX = 'fd_';
const MIGRATION_TABLE = 'migration';
EOF