Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] Issues with Build Server #115

Open
deleugpn opened this issue Apr 29, 2023 · 1 comment
Open

[v2] Issues with Build Server #115

deleugpn opened this issue Apr 29, 2023 · 1 comment

Comments

@deleugpn
Copy link
Member

While upgrading to Bref 2, I looked over at the Laravel bridge improvements and I decided to retire my own bridge.

I use AWS CodeBuild to build the project before releasing. That entails

  • Composer Install
  • PHPUnit run
  • Composer Install --no-dev

When Composer Installs without dev dependencies, it crashes with errors such as [...] CollisionServiceProvider not found. This seems to be caused by the fact that composer install will generate a cache of packages.php and services.php.
It might also be relevant that on the first run, BrefServiceProvider has not been downloaded yet and it's likely that the cache files are written down in bootstrap/cache/ standard folder.

I managed to fix this by doing two things: defining environment variables for the cache files and creating the storage directories outside of Lambda.

      - LAMBDA_TASK_ROOT=/var/task
      - APP_SERVICES_CACHE=/tmp/storage/bootstrap/cache/services.php
      - APP_PACKAGES_CACHE=/tmp/storage/bootstrap/cache/packages.php

These are the variables I added to my docker-compose setup for the build process.

image

The change to the original bootstrap/app.php seemed necessary because 1) the /tmp/storage folder does not exist by default and 2) the bref-init.php file is not being executed when running outside of Lambda (i.e. build server).

I'm not sure what recommendation/documentation/suggestion should be made to accommodate this usecase, so I thought I'd at least open a issue to allow folks to read through my approach to solving this.

@georgeboot
Copy link
Contributor

This seems like a build pipeline issue, not so much one in this package. Or am I missing something? I can successfully run a composer install --no-dev on my projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants