Skip to content

Instantly share code, notes, and snippets.

@garak
Last active Dec 22, 2021
Embed
What would you like to do?
bitbucket pipeline configuration for a Symfony project

This configuration is for a project running Symfony (2 or 3)

I did the image after not founding anything suitable (it was a quick search). If you found a better one, tell me.

The parameter.yml.dist file is supposed to contain sensible default values. Only the password is replaced at runtime. If you need to replace other values, just add other sed commands to the script node.

I load fixtures before running tests because I rely on a "load once" strategy (I use a bundle to revert all changes done by my tests). If you prefer to load fixtures inside your tests, you can remove thas command from script

If you need some additional php extension, you can add a line with installation. For example, to install intl extension, use - apt-get update && apt-get install -y -qq php-intl

image: garak/docker-php7
pipelines:
default:
- step:
script:
- cp app/config/parameters.yml.dist app/config/parameters.yml
- "sed -i 's/database_password: ~/database_password: root/' app/config/parameters.yml"
- service mysql start
- composer install -n --no-progress --no-suggest
- bin/console doctrine:database:create -e=test
- bin/console doctrine:schema:update --force -e=test
- bin/console doctrine:fixtures:load -n -e=test
- bin/phpunit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment