I am wondering if it is possible to spin up two different databases on the same mysql instance in bitbucket pipelines during testing
You could call the mysql client with the root password to create another database, like so:
image: php:7.2-fpm-alpine
pipelines:
default:
- step:
script:
- ...
- RUN apk add mysql-client
- mysql -u root -pyo -h 127.0.0.1 -e "CREATE DATABASE pipelines_secondary"
- ...
services:
- mysql
definitions:
services:
mysql:
image: mysql:5.7
environment:
MYSQL_DATABASE: 'pipelines'
MYSQL_ROOT_PASSWORD: 'yo'
MYSQL_USER: 'test_user'
MYSQL_PASSWORD: 'test_user_password'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.