-
Notifications
You must be signed in to change notification settings - Fork 63
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
issues when deploying via CI vs locally #20
Comments
Are you sure that the That's why we define the driver to |
I figured it out! We were both very close with our initial thoughts, the missing In GitLab CI I'm doing a multi stage build where my project is built in a PHP 7.4 image (composer steps listed above) and then it rolls into a node:alpine image that does the serverless deploy. Turns out that when it switches to that node image it re-fetches the code from git and the package discovery is never done so it doesn't know about any of the services (BrefServerProvider is never loaded). I plan to add my example CI build to the examples repo. I will have this Laravel requirement listed in the notes somewhere. For posterity, here's a simple example of what I'm using: stages:
- test
- build
- deploy
cache:
paths:
- vendor/
- bootstrap/cache/
test:
stage: test
image: php:7.4
artifacts:
reports:
junit: junit.xml
script:
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install --no-progress --prefer-dist
- vendor/bin/phpunit --coverage-text --colors=never --log-junit=junit.xml
build:
stage: build
image: php:7.4
script:
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install --no-dev --no-progress --prefer-dist
deploy:
stage: deploy
image: node:alpine
script:
- npm install -g serverless
- stage=$([ "$CI_COMMIT_REF_NAME" == "master" ] && echo "prod" || echo "staging")
- cp .env.$stage .env
- serverless deploy -v -s $stage |
I've got a barebones Laravel 8 project, setup per instructions at https://bref.sh/docs/frameworks/laravel.html. (The only difference is I'm using HTTP API).
When I deploy from my local machine the default welcome view renders without issue. When I deploy via CI I get this error with the welcome view:
There is no existing directory at "/var/task/storage/logs" and it could not be created: Read-only file system
.I don't believe there is any issue with the serverless portion of this as comparing the debug output (with SLS_DEPLOY=1) didn't show many differences.
I compared the output of my
.serverless/project.zip
that was created on my machine vs in CI and the only noticeable differences I saw was my CI version was missing:My ci config is as such:
Any thoughts on what I might be doing wrong?
The text was updated successfully, but these errors were encountered: