Pipeline script working locally but failing online

Hi,

I'm trying to setup Pipelines with my PHP 7, Laravel 5.3 app. I have created my own docker image to install php-gd, npm and postgres.

My Pipelines script works perfectly when I run it manually on a local docker instance but once online I get a lot of database exceptions  :

 

-  either "Unique violation" for unique index

- either "Too many connection" from the postgres daemon.

 

Using a local postgres instance on my image on the services definition ends up with the same errors.

Here is my pipeline conf : 


# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: jguerin/vendredi-pipelines

definitions:
services:
postgres:
image: postgres:9.4
environment:
POSTGRES_DB: 'vendredi'
POSTGRES_USER: 'vendredi'
POSTGRES_PASSWORD: 'vendredi'

pipelines:
branches:
experimental-bitbucket-pipelines:
- step:
caches:
- composer
- node

script:
# Configure the database
#- /etc/init.d/postgresql start
#- sudo -u postgres sh -c 'createdb vendredi'
#- sudo -u postgres sh -c "psql -c \"CREATE USER vendredi WITH PASSWORD 'vendredi';\""
#- sudo -u postgres sh -c 'psql -c "CREATE EXTENSION unaccent";'
- curl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
- export NVM_DIR="$HOME/.nvm"
- . "$NVM_DIR/nvm.sh"
- nvm install 6
- cp phpunit.xml.dist phpunit.xml
- cp .env.example .env
- composer install --no-interaction
- composer dump-auto
- php artisan key:generate
- npm install
- ./node_modules/.bin/gulp --production
- ./vendor/bin/phpunit

services:
- postgres%

 

 

0 answers

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

649 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot