Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

bitbucket-pipeline.yml for laravel 9+

drewkroft
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 25, 2023

Looking for bitbucket-pipeline.yml recommendations for Laravel 9+ projects.

The "official" recommendation is for Laravel 5, and is out of date.

Are others successfully using a 'sail' / 'composer' / or 'php8.x' image or configuration?

DB: sqlite / memory?

I've wasted a lot of time and build minutes and frustrated with little progress.

Thank you!

 

2 answers

1 vote
Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 28, 2023

Hi there,

Thank you for reaching out to Atlassian Community.

When I accessed the Laravel 9's website, I was able to see that they have their own built Docker image: 

laravelsail/php82-composer

I would like to recommend you to give it a try and let us know if it works

0 votes
elanclarkson March 25, 2024 edited

I got a simple install & test step to run using PHP 8.3, Laravel 11 and Postgres as follows:

 

image: php:8.3-fpm

definitions:
services:
postgres:
image: postgres:16
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"

pipelines
:
branches:
master:
- step:
name: Install & Test
caches:
- composer
script:
- apt-get update && apt-get install -qy git unzip libzip-dev libpq-dev
- docker-php-ext-install zip pdo pdo_pgsql
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- ln -f -s .env.pipelines .env
- php artisan migrate --force
- php artisan test
services:
- postgres
I also found a self-answered question here for Laravel 8+: https://stackoverflow.com/questions/64384734/laravel-bitbucket-pipelines-configuration
Omer Farooq
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 2, 2024

I have almost the same setup. But i am not able to connect to the postgres database using the .env. I have tried alot of different variations in my .env file but was not able to find the solution. 

definitions:
services:
postgres:
image: postgres:16
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
PGPASSWORD: 'secret'
POSTGRES_DB: 'laravel'
POSTGRES_USER: 'laravel'
POSTGRES_PASSWORD: 'secret'

(I have also tried removing the auth method. )

Here is my .env

 

DB_CONNECTION=pgsql
DB_HOST=postgres # tried 0.0.0.0, localhost, 127.0.0.1
DB_PORT=5432
DB_DATABASE=laravel
DB_USERNAME=laravel
DB_PASSWORD=secret

If possible please share your .env file content. Thanks

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Upcoming Bitbucket Events