feat: use goreleaser
Some checks failed
Markdown linter / markdown-lint (push) Successful in 13s
Golang Tests / unittest (push) Successful in 33s
Release / release (push) Failing after 4m54s
Release / sync-to-hub-docker-io (push) Has been skipped

This commit is contained in:
2025-05-31 21:18:20 +02:00
parent c9065425b1
commit 4c7ce56f1b
16 changed files with 400 additions and 838 deletions

View File

@@ -1,21 +1,18 @@
# db-wait
[![Build Status](https://drone.cryptic.systems/api/badges/volker.raschek/db-wait/status.svg)](https://drone.cryptic.systems/volker.raschek/db-wait)
[![Docker Pulls](https://img.shields.io/docker/pulls/volkerraschek/db-wait)](https://hub.docker.com/r/volkerraschek/db-wait)
With `db-wait` is it possible to wait in CI/CD environments until a database
connection can be established and SQL queries are possible.
With `db-wait` is it possible to wait in CI/CD environments until a database connection can be established and SQL
queries are possible.
This is very useful for example when a database is started for an integration
test and it needs time to start and initialize all schemes before the test
connects to it.
This is very useful for example when a database is started for an integration test and it needs time to start and
initialize all schemes before the test connects to it.
## Usage
As argument db-wait expects a database URI. This can be different depending on
the backend. Currently only oracle and postgres are supported. The supported URI
patterns can be found in the respective library or directly in the documentation
of the database backend.
As argument db-wait expects a database URI. This can be different depending on the backend. Currently only oracle and
postgres are supported. The supported URI patterns can be found in the respective library or directly in the
documentation of the database backend.
For example:
@@ -28,15 +25,14 @@ db-wait oracle://user:password@localhost:1521/xe
```
More about URI Pattern is documented here for
[oracle](https://godror.github.io/godror/doc/connection.html#-connection-strings)
and
[oracle](https://godror.github.io/godror/doc/connection.html#-connection-strings) and
[postgres](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING).
## Installation
There are two ways to install `db-wait`. Directly via `go` or via `make` in
combination with `git` and `go`. The advantage of the second option is that the
binary is installed with all the additional files that the developer specifies.
There are two ways to install `db-wait`. Directly via `go` or via `make` in combination with `git` and `go`. The
advantage of the second option is that the binary is installed with all the additional files that the developer
specifies.
```bash
# go
@@ -50,15 +46,14 @@ $ git clone https://git.cryptic.systems/volker.raschek/db-wait.git && \
## Usage as container image
Alternatively can be `db-wait` used as container image. A local installation is
not necessary.
Alternatively can be `db-wait` used as container image. A local installation is not necessary.
```bash
# postgres
$ docker run --rm --network host docker.io/volkerraschek/db-wait:latest \
$ docker run --rm --network host git.cryptic.systems/volker.raschek/db-wait:latest \
postgres://user:password@localhost:5432/postgres?sslmode=disable
# oracle
$ docker run --rm --network host docker.io/volkerraschek/db-wait:latest \
$ docker run --rm --network host git.cryptic.systems/volker.raschek/db-wait:latest \
oracle://user:password@localhost:1521/xe
```