Cannot deploy the DB with Symfony 3.0
<p>I have made a post-receive hook on a git repository to my server:</p>

<pre><code>#!/bin/bash

echo "Deploy to server"

tempdir="/home/pcmagas/deploy/master"

if [[ ! -d $tempdir ]]; then
    echo -e "\tCreating branch dir: ${tempdir}"
    mkdir -p ${tempdir}
fi

# Locally deploy code

echo -e "\tCleaning..."
git --work-tree=${tempdir} clean -fd master -- .
echo -e "\tPushing To temporary directory..."
git --work-tree=${tempdir} checkout -f master -- .
chmod 775 ${tempdir} -R


echo "Installing 3rd party libraries"
cd ${tempdir}
composer install
#mkdir ${tempdir}/var/cache/prod
#bower install
#npm install gulp gulp-util gulp-rename gulp-uglify
#gulp prod

echo "Setting Up Database Changes"

export OPENSHIFT_POSTGRESQL_DB_HOST=localhost 
export OPENSHIFT_POSTGRESQL_DB_PORT=5432
export OPENSHIFT_APP_NAME=symphotest
export OPENSHIFT_POSTGRESQL_DB_USERNAME=symphotest
export OPENSHIFT_POSTGRESQL_DB_PASSWORD=samplepasswd


php bin/console doctrine:database:create --if-not-exists

php bin/console doctrine:generate:entity AppBundle
php bin/console doctrine:schema:update --force

#echo "Moving to server"
#rsync -rav  --delete --progress -T /tmp --exclude-from=${tempdir}/exclude.txt --chown "www-data" ${tempdir}/ /home/www/syphotest/htdocs/ &gt; ~/logs.txt

#echo "Fixing Permissions"
#sudo chown -R www-data:www-data /home/www/syphotest/htdocs/*
#sudo chmod +w /home/www/syphotest/htdocs/var/cache/prod
#sudo chown www-data:www-data /home/www/syphotest/htdocs/var/cache/prod
#sudo chown www-data:www-data /home/www/syphotest/htdocs/var/logs
#sudo chown www-data:www-data /home/www/syphotest/htdocs/app/
</code></pre>

<p>But when the script runs these commands it fails to generate the tables:</p>

<pre><code>php bin/console doctrine:database:create --if-not-exists

php bin/console doctrine:generate:entity AppBundle
php bin/console doctrine:schema:update --force
</code></pre>

<p>The config.yml is:</p>

<pre><code>imports:
    - { resource: params.php }
    - { resource: security.yml }
    - { resource: services.yml }

# Put parameters here that don't need to change on each machine where the app is deployed
# http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
    locale: en

framework:
    #esi:             ~
    #translator:      { fallbacks: ["%locale%"] }
    secret:          "%secret%"
    router:
        resource: "%kernel.root_dir%/config/routing.yml"
        strict_requirements: ~
    form:            ~
    csrf_protection: ~
    validation:      { enable_annotations: true }
    #serializer:      { enable_annotations: true }
    templating:
        engines: ['twig']
        #assets_version: SomeVersionScheme
    default_locale:  "%locale%"
    trusted_hosts:   ~
    trusted_proxies: ~
    session:
        # http://symfony.com/doc/current/reference/configuration/framework.html#handler-id
        handler_id:  session.handler.native_file
        save_path:   "%kernel.root_dir%/sessions/%kernel.environment%"
    fragments:       ~
    http_method_override: true
    assets: ~

# Twig Configuration
twig:
    debug:            "%kernel.debug%"
    strict_variables: "%kernel.debug%"

# Doctrine Configuration
doctrine:
    dbal:
        driver:   "%database_driver%"
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"
        charset:  UTF8
        # if using pdo_sqlite as your database driver:
        #   1. add the path in parameters.yml
        #     e.g. database_path: "%kernel.root_dir%/data/data.db3"
        #   2. Uncomment database_path in parameters.yml.dist
        #   3. Uncomment next line:
        #     path:     "%database_path%"

    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        naming_strategy: doctrine.orm.naming_strategy.underscore
        auto_mapping: true

# Swiftmailer Configuration
swiftmailer:
    transport: "%mailer_transport%"
    host:      "%mailer_host%"
    username:  "%mailer_user%"
    password:  "%mailer_password%"
    spool:     { type: memory }
</code></pre>

<p>And the parameters for the connection are:</p>

<pre><code>&lt;?php
  $container-&gt;setParameter('secret','samplesecret');

  // Db Parameters
  $container-&gt;setParameter('database_driver','pdo_pgsql');
  $container-&gt;setParameter('database_host', getenv("OPENSHIFT_POSTGRESQL_DB_HOST"));
  $container-&gt;setParameter('database_port', getenv("OPENSHIFT_POSTGRESQL_DB_PORT"));
  $container-&gt;setParameter('database_name', getenv("OPENSHIFT_APP_NAME"));
  $container-&gt;setParameter('database_user', getenv("OPENSHIFT_POSTGRESQL_DB_USERNAME"));
  $container-&gt;setParameter('database_password', getenv("OPENSHIFT_POSTGRESQL_DB_PASSWORD"));

  //mailer_host
  $container-&gt;setParameter('mailer_transport', 'smtp');
  $container-&gt;setParameter('mailer_host', '127.0.0.1');
  $container-&gt;setParameter('mailer_user', null);
  $container-&gt;setParameter('mailer_password', null);
?&gt;
</code></pre>

<p>On my script I managed to export the enviroment variables:</p>

<pre><code>export OPENSHIFT_POSTGRESQL_DB_HOST=localhost 
export OPENSHIFT_POSTGRESQL_DB_PORT=5432
export OPENSHIFT_APP_NAME=symphotest
export OPENSHIFT_POSTGRESQL_DB_USERNAME=symphotest
export OPENSHIFT_POSTGRESQL_DB_PASSWORD=samplepasswd
</code></pre>

<p>But somehow it fails to use them and I get the following errors:</p>

<pre><code>  [Doctrine\DBAL\Exception\ConnectionException]                                          
  An exception occured in driver: SQLSTATE[08006] [7] fe_sendauth: no password supplied  



  [Doctrine\DBAL\Driver\PDOException]                    
  SQLSTATE[08006] [7] fe_sendauth: no password supplied  



  [PDOException]                                         
  SQLSTATE[08006] [7] fe_sendauth: no password supplied  


doctrine:database:create [--connection [CONNECTION]] [--if-not-exists] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] &lt;command&gt;



  [Symfony\Component\Console\Exception\RuntimeException]  
  Too many arguments.                                     


doctrine:generate:entity [--entity ENTITY] [--fields FIELDS] [--format FORMAT] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] &lt;command&gt;



  [Doctrine\DBAL\Exception\ConnectionException]                                          
  An exception occured in driver: SQLSTATE[08006] [7] fe_sendauth: no password supplied  



  [Doctrine\DBAL\Driver\PDOException]                    
  SQLSTATE[08006] [7] fe_sendauth: no password supplied  



  [PDOException]                                         
  SQLSTATE[08006] [7] fe_sendauth: no password supplied  


doctrine:schema:update [--complete] [--dump-sql] [-f|--force] [--em [EM]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] &lt;command&gt;
</code></pre>

<p>My postgresql configuration is <em>(/etc/postgresql/9.3/main/pg_hba.conf)</em>:</p>

<pre><code># DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all             all             localhost            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5
</code></pre>

<p>Please I need you help. For some reason it cannot find the password. I do not know the solution to the problem.</p>