Deployer: Not ask for credentials for private repository during composer install

Created on 25 Jul 2016  路  1Comment  路  Source: deployphp/deployer

| Q | A |
| --- | --- |
| Issue Type | Question |
| Deployer Version | 3.2 |
| Local Machine OS | Debian 8.4 |
| Remote Machine OS | N/A |

Description

I have a private repository on the bitbucket which is Symfony bundle and localy when I run composer update it ask me about password, because entry in my composer.json is similar to (please not about https instead of ssh.):

"repositories": [
        {
            "type": "vcs",
            "url":  "https://[email protected]/me/some-bundle.git"
        }
    ],

But when I deploy my app the task of deploy:vendors throws:

[RuntimeException]                                                                                                                          
  Loading composer repositories with package information                                                                                      


    [RuntimeException]                                                                                                                        

    Failed to execute git clone --mirror 'https://[email protected]/me/some-bundle.git' '/home/acropol/  
  .composer/cache/vcs/https---me-bitbucket.org-me-some-bundle.git/'                                     
    Cloning into bare repository '/home/app/.composer/cache/vcs/https---me-bitbucket.org-me-permission-b  
  undle.git'...                                                                                                                               
    remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your a  
  ccount profile.                                                                                                                             
    fatal: Authentication failed for 'https://[email protected]/me/some-bundle.git/'                     



  install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-p  
  rogress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<pac  
  kages>]...   

Is there any option to tell deployer to ask for credentials during deploy?

Content of deploy.php

<?php

// All Deployer recipes are based on `recipe/common.php`.
require __DIR__.'/vendor/deployer/deployer/recipe/symfony3.php';

// dev server
server('dev', 'host.example.com', 18080)
    ->user('username')
    ->identityFile()
    ->stage('dev')
    ->env('deploy_path', '/var/www/html/myapp/dev')
    ->env('branch', 'develop')
    ->env('env_vars', 'SYMFONY_ENV=dev')
    ->env('env', 'dev')
    ->env('composer_options', 'install')
;

// override from symfony recipe
task('deploy:clear_controllers', function () {})->setPrivate();

set('shared_dirs', ['var/logs', 'var/sessions', 'app/var']);
set('writable_dirs', ['var/cache', 'var/logs', 'var/sessions', 'app/var']);

set('repository', 'ssh://[email protected]/repo.git');

after('deploy:vendors', 'database:migrate');

>All comments

Please using public key instead enter password.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sweebee picture sweebee  路  3Comments

JonasDoebertin picture JonasDoebertin  路  4Comments

ovaiskhan11 picture ovaiskhan11  路  4Comments

greatwitenorth picture greatwitenorth  路  4Comments

brunodevel picture brunodevel  路  3Comments