Skip to content

peterfox/waitformysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

WaitForMySQL

A simple command-line tool for blocking scripts from running until a connection is established or a timeout is reached.

This tool was designed to be used in build scripts for things like Travis CI where I was often running into problems with the MySQL docker container command completing before the new database was ready. This meant further steps failed and I kept having to add more time to the build by using the sleep command. Eventually I decided to make this. I now use it to block the build process until the database is ready or an appropriate amount of time has passed.

Usage

CLI usage is pretty simple as set out below. You only need specify the password currently.

  -database string
        database name
  -host string
        database host (default "127.0.0.1")
  -password string
        database password
  -port string
        database port (default "3306")
  -timeout duration
        max timeout in seconds (default 25s)
  -username string
        database username (default "root")

Building

A make file is included. You should be able to simply run make to build the binaries for macOS, Linux and Windows.

About

A mini golang util for waiting for a mysql database to be up

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published