I'm using Bitbucket Pipelines to run integration tests. I need to spin up a docker container to mimic the database so the tests can run. However, before I can run the tests, I need to add seed data to the database.
It seems like whether I add the mongo images as a service or add docker as a service, I still have to figure out a way to do the setup in the image from the script section of the default step, which is in a separate container.
That seems like a lot of unnecessary work, so my question is, is there an easier way?
For example:
image: dotnet
pipelines:
default:
- step:
services:
- database
script:
- dotnet restore
- dotnet build
definitions:
services:
database:
image: mongo
<it would be really nice if I could add setup steps here>