wait-until

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2019 License: MIT Imports: 6 Imported by: 0

README

Wait Until

Command line utility which holds up execution of a bash pipeline until a given command returns a desired exit code.

Useful for preventing race conditions in build pipelines.

Examples

Wait until the database container is accepting connections before importing the SQL dump.

docker-compose up -d
wait-until --timeout=60s -- mysqladmin ping -h 127.0.0.1
mysql < db.sql

Wait for redis to accept connections before starting the app.

wait-until --retries=5 --sleep=5s -- redis-cli ping
./app start

Usage

usage: wait-until [<flags>] <command>

Flags:
      --help             Show context-sensitive help (also try --help-long and --help-man).
  -v, --verbose          Enabled verbose output.
  -t, --timeout=TIMEOUT  Timeout before aborting pipeline. Omit for no limit.
  -r, --retries=-1       Number of attempts before aborting pipeline. -1 for no limit.
  -s, --sleep=1s         Sleep time between each execution.
  -e, --exit-code=0      Desired exit code before allowing pipeline to proceed.

Args:
  <command>  Command to repeatedly execute until exit code met, timeout exceeded, or retry limit exceeded.

Notes

It is recommended to use the +pipefail bash directive when using this tool to ensure failures in this command terminate the pipeline.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL