buildpacks
buildpacks copied to clipboard
Add custom composer arguments support
Because of --no-dev
flag composer args are suitable only for production build. To allow dev or staging work COMPOSER_ARGS
environment variable is introduced.
COMPOSER_ARGS
can be used to override default composer args.
Perhaps I can add some more information on why this PR is important. AppEngine is a great tool in production but running apps locally was always complex. If you get a configuration mismatch between your local and production (for example with allowed functions, or dynamic modules), your app might work locally and pass unit tests, and then throw nasty 500 on production after the successful deployment.
For a long time, the only repo that was providing environment comparable to App Engine production was https://github.com/GoogleCloudPlatform/php-docker . It was constantly outdated and poorly documented.
Buildpacks opened a new way to set up local and CI/CD environments equal to production, however --no-dev
flag explicitly blocks the installation of necessary dependencies.
This simple PR (which might need quick testing), would essentially allow using buildpacks for all non-production environments and provide solution to most of issues in https://github.com/GoogleCloudPlatform/php-docker/issues .
COMPOSER_ARGS
renamed to GOOGLE_COMPOSER_ARGS
I got formatting error in the php.go file blocking the merge. I believe they are:
- Imports aren't sorted. "strings" import needs to be after the "path/filepath" import
- there are extra trailing whitespaces on the line:
flags = []string{"--no-dev", "--no-progress", "--no-interaction", "--optimize-autoloader"}
you can also try running go format to see if there are other issues.