0

I'm trying to use bitBucket Pipeline with a Laravel. But everytime that run the pipeline return the follow error:

> post-install-cmd: Illuminate\Foundation\ComposerScripts::postInstall
> post-install-cmd: php artisan optimize --verbose
Generating optimized class loader
Compiling common classes
Script php artisan optimize --verbose handling the post-install-cmd event returned with an error

  [RuntimeException]  
  Error Output:       

Exception trace:
 () at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:196
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:94
 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/local/bin/composer/src/Composer/Installer.php:350
 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php:134
 Composer\Command\InstallCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:256
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:838
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:189
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:167
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:120
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:98
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:43
 require() at /usr/local/bin/composer:25

bitbucket-pipelines.yml:

# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: phpunit/phpunit:5.0.3

pipelines:
  default:
    - step:
        script: # Modify the commands below to build your repository.
          - composer install --verbose
Vadim Kotov
  • 7,103
  • 8
  • 44
  • 57
Phelipe Rocha
  • 126
  • 3
  • 14
  • Was there any error output? Have you tried using the `--no-interaction` flag? Additionally, you may want to add a `composer self-update` before the install to make sure it's not complaining about an outdated composer version. – patricus Dec 19 '16 at 23:07
  • @patricus I just tried right now to use self-update and --no-interaction flag.. But still nothing... With this flag it's showing like that "Script php artisan optimize handling the post-install-cmd event returned with error code 255" – Phelipe Rocha Dec 19 '16 at 23:22
  • 1
    Try adding `--verbose` to see if you get any more useful messages. – patricus Dec 19 '16 at 23:31
  • Now i tested with `--verbose` in both composer and artisan command.. This returned with more information, I already edited question with new informations – Phelipe Rocha Dec 22 '16 at 11:41

1 Answers1

1

The problem was solved, I needed to set some environments variable.

To be more specific, I use a collect errors' service called rollbar (really good by the way)

And in config/services.php it was setted like that:

'rollbar' => [
    'access_token' => env('ROLLBAR_ACCESS_TOKEN'),
    'level' => env('ROLLBAR_LEVEL', 'error'),
],

I just needed to set ROLLBAR_ACCESS_TOKEN variable in Settings/PIPELINES/Environment variables on BitBucket

Phelipe Rocha
  • 126
  • 3
  • 14