Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Laravel is not deployed in App Engine with Bitbucket pipelines

Dulce Hernandez Cruz June 4, 2020

I'm trying to deploy a Laravel project to App Engine through Bitbucket pipelines but it's not working. I don't get any error in the pipelines but the site is not displayed correctly, it returns a 500 error. When checking the logs I see this error:

2020-06-05 04:58:20 default[20200605t045622] 2020/06/05 04:58:20 [error] 20#20: *8 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught ReflectionException: Class view does not exist in /srv/vendor/laravel/framework/src/Illuminate/Container/Container.php:805 Stack trace: #0 /srv/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): ReflectionClass->__construct('view') #1 /srv/vendor/laravel/framework/src/Illuminate/Container/Container.php(687): Illuminate\Container\Container->build('view') #2 /srv/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(796): Illuminate\Container\Container->resolve('view', Array, true) #3 /srv/vendor/laravel/framework/src/Illuminate/Container/Container.php(633): Illuminate\Foundation\Application->resolve('view', Array) #4 /srv/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(781): Illuminate\Container\Container->make('view', Array) #5 /srv/vendor/laravel/framework/src/Illuminate/Container/Container.php(1280): Illuminate\Foundation\Application->make('view') #6 /srv/vendor/laravel/framework/src/Illuminate/Support/Facades/Fac...PHP message: PHP Fatal error: Uncaught ReflectionException: Class view does not exist in /srv/vendor/laravel/framework/src/Illuminate/Container/Container.php:805

 

If I deploy the app manually with gcloud app deploy app-staging.yaml, it works.

Here is my script, what could be missing? 

image: lbausch/laravel-ci
definitions:
steps:
- step: &build-image
name: Build image
script:
#Copy Environment File
- cp .env.pipelines .env

#Install Composer
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
artifacts:
- vendor/**

#Migrate Database
- php artisan key:generate
- php artisan migrate
- step: &lint
name: Linting
script:
#Copy Environment File
- cp .env.pipelines .env
#Install Composer
- composer install
- composer run lint
- step: &unit-testing
name: Unit Testing
script:
- apt-get install libpng-dev -y --no-install-recommends
#Copy Environment File
- cp .env.pipelines .env
#Install Composer
- composer install
#Run Test Suite
- ./vendor/bin/phpunit --verbose
pipelines:
branches:
master:
- step: *build-image
- step: *lint
- step: *unit-testing
- step:
name: Deploy to Production
deployment: production
trigger: manual
script:
- pipe: atlassian/google-app-engine-deploy:0.7.2
variables:
KEY_FILE: $KEY_FILE
PROJECT: $PROJECT_ID
DEPLOYABLES: 'app.yaml'
develop:
- step: *build-image
- step: *lint
- step: *unit-testing
- step:
name: Deploy to Development
deployment: staging
trigger: automatic
script:
- pipe: atlassian/google-app-engine-deploy:0.7.2
variables:
KEY_FILE: $KEY_FILE
PROJECT: $PROJECT_ID
DEPLOYABLES: 'app-staging.yaml'
'{feature/*,bugfix/*,hotfix/*,release/*}':
- step: *build-image
- step: *lint
- step: *unit-testing

 

Thanks

1 answer

1 accepted

0 votes
Answer accepted
ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2020

From the error the view class is missing.

This could signal a configuration issue, e.g. if the `.env` file needs to be deployed, make it an artifact, too (like you did with the composer vendor folder).

Dulce Hernandez Cruz June 5, 2020

Thanks a lot @ktomk! This solved the problem :) 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events