Buddy is a smart tool that lets you build and deploy your web projects. Before the application is deployed to the server, however, it is first tested in preconfigured Docker containers. Some of the tests, e.g. integration, E2E or Selenium, require a fully operational application with things like a database and session storage.

Buddy supports this functionality with microservices activated in build actions:

In response to growing demand from our clients, we have added database seeding for the 3 most popular database services: MySQL, Postgres, and MariaDB.

How database seeding works

First, you need to upload the file with SQL dump (.sql, .sql.gz). You can do it either by adding the file to the repo (not recommended), or by uploading it to the pipeline’s Filesystem as a static file. Once the file is in the Filesytem, it’s enough that you point to it in the service details.

How it works upon loading the database

Buddy will load the database from the dump every time the build is triggered. If you wish, you can speed up the builds by checking ‘Cache database between executions’ in the service options. This way the database will be loaded from the dump only on the first execution.

If you want to upload a fresh instance of the database, make sure to run the execution with the ‘Clear cache’ flag.

Define the default database

From now on, you can also define the default name of the database that will be created in the beginning. If you did specify the SQL dump in the pipeline, Buddy will import the data from that database. Otherwise, it will create an empty database using the default name.

What’s next

In the future, it will be possible to define custom services using docker-compose – a feature that will let you configure even the most advanced use cases. Stay tuned for more info!

Buddy is 100% customer driven. If there’s a feature or integration you miss, let us know in the comments below or directly at support@buddy.works.