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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 06, 2018 in Bitbucket

Do you use Bitbucket Cloud and Jira Cloud? If so, let us know!

Hi Community, I'm Julia and I'm on the Jira Software Cloud marketing team!  We're looking for companies or teams using Bitbucket Cloud and Jira Software Cloud. If your team fits the t...

96 views 4 3
Join discussion

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