Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicksantamaria/wait-until
Command line utility which can block a pipeline until a command returns a desired exit code.
https://github.com/nicksantamaria/wait-until
Last synced: 2 days ago
JSON representation
Command line utility which can block a pipeline until a command returns a desired exit code.
- Host: GitHub
- URL: https://github.com/nicksantamaria/wait-until
- Owner: nicksantamaria
- License: mit
- Created: 2019-09-12T14:12:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-12T14:27:24.000Z (about 5 years ago)
- Last Synced: 2024-06-20T10:10:02.554Z (5 months ago)
- Language: Go
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
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.
```bash
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.
```bash
wait-until --retries=5 --sleep=5s -- redis-cli ping
./app start
```## Usage
```bash
usage: wait-until []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 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.