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

Bitbucket Pipes PHP - Google App Engine Standard deploy - composer install not running

tomerrett June 10, 2019

Is there a way to run `composer install` as a part of the bitbucket pipes pipeline for Google App Engine Standard? Currently my PHP code is being deployed without running composer install so no dependancies are deployed. Is there a way around this or can I not use Bitbucket Pipes for this? I have tried running composer in another step in the pipeline - however the code that the pipe deploys is not from the previous step as below:

bitbucket-pipelines.yml

image: php:7.2.9
pipelines:
branches: uat:
-
step:
script:
-
apt-get update && apt-get install -y unzip
-
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
-
composer require monolog/monolog
-
composer install
-
step: name: Deploy to UAT deployment: uat
script:
-
pipe: atlassian/google-app-engine-deploy:0.3.1 variables: KEY_FILE: $KEY_FILE PROJECT: '**project**' DEPLOYABLES: 'app.yaml' PROMOTE: 'true' STOP_PREVIOUS_VERSION: 'true'

 

1 answer

1 accepted

2 votes
Answer accepted
Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 11, 2019

Hi @tomerrett . It looks like you don't really need to run composer install yourself as gcloud should do this for you. This page shows how to configure you application so all dependencies are automatically installed each time you deploy a new version of the app.  Let us know if this doesn't work for you. 

tomerrett June 13, 2019

Thanks, yes you are correct, seems like there is an issue in google app engine, where the 'post-autoload-dump' triggered script in composer.json that runs @Php artisan package:discover does not run (or does not have write access to the filesystem) hence deploy fails.

tomerrett June 13, 2019

but in general @Alexander Zhukov is there a way to build code in other steps and then pass it to a pipe? or is this not supported?

Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 9, 2019

Yes, that's totally possible with pipelines artifacts.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events