Setup MySQL using Docker
This can be done by following this tutorial by pulling the 5.6.44 version of mysql.
or
- run
docker pull mysql:5.6.44
to download the mysql image. - run
docker run --name mysqldb --restart unless-stopped -e MYSQL_ROOT_PASSWORD=mysql -p 3306:3306 -d mysql:5.6.44
to run your local mysql server at port 3306. - run
docker ps -a
to check if your mysql server is up. - run
docker exec -it mysqldb mysql -u root -p
to login into your local mysql server using your root account. - Once logged in, run
create database liquibasetest;
to create a database in your local mysql server. - run
show databases;
to make sure you haveliquibasetest
database created.
Test Changes Locally Before Making Commit
- run
docker start mysqldb
to ensure your local mysql server is running. - At
home
directory, runmvn liquibase:tag -Dliquibase.tag=initial
to create a liquibase tag. - run
mvn liquibase:update
to execute all changesets. - run
mvn liquibase:rollback -Dliquibase.rollbackTag=initial
to revert all changesets.
Continuous Integration
- run
docker start mysqldb
to ensure your local mysql server is running. - run this DemoApplication to start build via Spring Boot.