Pipeline script working locally but failing online


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

image: postgres:9.4
POSTGRES_DB: 'vendredi'
POSTGRES_USER: 'vendredi'

- step:
- composer
- node

# 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

- postgres%



0 answers

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
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...

1,764 views 1 5
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