iamdork / recipes

Annotated examples dork-compose usage.
0 stars 1 forks source link

drupal-fancy requires GITHUB_PRIVATE_TOKEN to use git:// #1

Open ohthehugemanatee opened 8 years ago

ohthehugemanatee commented 8 years ago

unless you set a GITHUB_PRIVATE_TOKEN, you will fail with

Failed to execute git clone --no-checkout 'git@github.com:AmazeeLabs/varnish.git' 'web/modules/contrib/varnish' && cd 'web/modules/contrib/varnish' && git remote add composer 'git@github.com:AmazeeLabs/varnish.git' && git fetch composer (for example)

I modified composer-install.sh to collect debug info with

export GIT_TRACE=2
export GIT_CURL_VERBOSE=1
composer install --dev -vvv

The failure is

  - Installing drupal/varnish (8.1.0-dev 8.x-1.x-amazee)
    Cloning 8.x-1.x-amazee
Executing command (CWD): git clone --no-checkout 'git@github.com:AmazeeLabs/varnish.git' 'web/modules/contrib/varnish' && cd 'web/modules/contrib/varnish' && git remote add composer 'git@github.com:AmazeeLabs/varnish.git' && git fetch composer
Executing command (CWD): git config github.accesstoken
Executing command (CWD): git --version
Failed: [RuntimeException] Failed to execute git clone --no-checkout 'git@github.com:AmazeeLabs/varnish.git' 'web/modules/contrib/varnish' && cd 'web/modules/contrib/varnish' && git remote add composer 'git@github.com:AmazeeLabs/varnish.git' && git fetch composer

11:39:54.227383 git.c:349               trace: built-in: git 'config' 'github.accesstoken'

  [RuntimeException]                                                                                                                                                                                                                            
  Failed to execute git clone --no-checkout 'git@github.com:AmazeeLabs/varnish.git' 'web/modules/contrib/varnish' && cd 'web/modules/contrib/varnish' && git remote add composer 'git@github.com:AmazeeLabs/varnish.git' && git fetch composer  
  11:39:54.227383 git.c:349               trace: built-in: git 'config' 'github.accesstoken'                                                                                                                                                    

Exception trace:
 () at phar:///usr/bin/composer/src/Composer/Util/Git.php:304
 Composer\Util\Git->throwException() at phar:///usr/bin/composer/src/Composer/Util/Git.php:199
 Composer\Util\Git->runCommand() at phar:///usr/bin/composer/src/Composer/Downloader/GitDownloader.php:70
 Composer\Downloader\GitDownloader->doDownload() at phar:///usr/bin/composer/src/Composer/Downloader/VcsDownloader.php:72
 Composer\Downloader\VcsDownloader->download() at phar:///usr/bin/composer/src/Composer/Downloader/DownloadManager.php:213
 Composer\Downloader\DownloadManager->download() at phar:///usr/bin/composer/src/Composer/Installer/LibraryInstaller.php:186
 Composer\Installer\LibraryInstaller->installCode() at phar:///usr/bin/composer/src/Composer/Installer/LibraryInstaller.php:90
 Composer\Installer\LibraryInstaller->install() at phar:///usr/bin/composer/src/Composer/Installer/InstallationManager.php:173
 Composer\Installer\InstallationManager->install() at phar:///usr/bin/composer/src/Composer/Installer/InstallationManager.php:160
 Composer\Installer\InstallationManager->execute() at phar:///usr/bin/composer/src/Composer/Installer.php:542
 Composer\Installer->doInstall() at phar:///usr/bin/composer/src/Composer/Installer.php:216
 Composer\Installer->run() at phar:///usr/bin/composer/src/Composer/Command/InstallCommand.php:135
 Composer\Command\InstallCommand->execute() at phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php:259
 Symfony\Component\Console\Command\Command->run() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:844
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:192
 Symfony\Component\Console\Application->doRun() at phar:///usr/bin/composer/src/Composer/Console/Application.php:231
 Composer\Console\Application->doRun() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:123
 Symfony\Component\Console\Application->run() at phar:///usr/bin/composer/src/Composer/Console/Application.php:104
 Composer\Console\Application->run() at phar:///usr/bin/composer/bin/composer:43
 require() at /usr/bin/composer:24

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

ERROR: Service 'web' failed to build: The command '/bin/sh -c bash /composer-install.sh' returned a non-zero code: 1
pmelab commented 8 years ago

Composer will prompt for authentication to bypass github rate limiting. https://getcomposer.org/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens

The access token is required to automatically authenticate, since the prompt will break docker build. As far as I can tell, this is working as intended.

ohthehugemanatee commented 8 years ago

can we authenticate with id_rsa instead?