Created
October 22, 2017 15:48
-
-
Save samonzeweb/e7d066429712102f0980b00e51cc3997 to your computer and use it in GitHub Desktop.
Testing godb on MariaDB through docker (OSX/Linux)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| docker run --name mariadb -e 'MYSQL_ROOT_PASSWORD=NotSoStr0ngPassword' -p 3306:3306 -d mariadb:latest | |
| sleep 10 | |
| docker exec -it mariadb mysql -uroot -pNotSoStr0ngPassword -hlocalhost -e "create database godb;" | |
| # See https://github.com/go-sql-driver/mysql#dsn-data-source-name | |
| GODB_MYSQL="root:NotSoStr0ngPassword@/godb?parseTime=true" go test | |
| docker stop mariadb | |
| docker rm mariadb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment