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

Pipeline script working locally but failing online

jguerin July 26, 2017

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
TAGS
AUG Leaders

Atlassian Community Events