Files
dbtool/.woodpecker/build.yaml

112 lines
3.6 KiB
YAML
Raw Permalink Normal View History

2025-11-16 20:55:18 +01:00
matrix:
platform:
- linux/amd64
labels:
platform: ${platform}
steps:
2025-11-21 00:33:11 +01:00
build-berkeley:
2025-11-16 20:55:18 +01:00
when:
event: [push]
image: alpine:latest
commands:
- apk update
2025-11-21 14:06:32 +01:00
- apk add --no-cache bash build-base gdb perl pcre2 pcre2-dev db db-dev pkgconfig meson ninja
2025-11-21 00:33:11 +01:00
- meson setup --reconfigure build
- ninja -C build
2025-11-21 14:06:32 +01:00
test-berkeley:
when:
event: [push]
image: alpine:latest
commands:
- apk update
- apk add --no-cache bash build-base pcre2 pcre2-dev db db-dev
2025-11-21 00:33:11 +01:00
- rm -f test.db
2025-11-21 14:06:32 +01:00
# insert keys
- build/dbtool -d test.db -i -k test -v blah
- build/dbtool -d test.db -i -k foo -v bar
# look if the appear in the dump
2025-11-21 00:33:11 +01:00
- build/dbtool -d test.db -D | grep blah
2025-11-21 14:06:32 +01:00
# count 'em
- build/dbtool -d test.db -D | wc -l | grep 2
# search for key
- build/dbtool -d test.db -s -k test
# search for key regex
- build/dbtool -d test.db -S -k 't$'
# remove key
- build/dbtool -d test.db -r -k foo
# count must match
- build/dbtool -d test.db -D | wc -l | grep 1
# modify a key
- build/dbtool -d test.db -u -k test -v modified
# check modified key
- build/dbtool -d test.db -s -k test | grep modified
# use splitting with regex
- echo today:100 | build/dbtool -d test.db -i -f -t '^([^:]*):([^:]*)'
2025-11-21 14:06:32 +01:00
# check if it works
- build/dbtool -d test.db -s -k today | grep 100
# use splitting with regex reverse
- echo today:cold | build/dbtool -d test.db -R -i -f -t '^([^:]*):([^:]*)'
# check if it works
- build/dbtool -d test.db -s -k cold | grep today
# check encryption
- build/dbtool -d test.db -i -k borg -v sevenofnine -p -P foobar
- build/dbtool -d test.db -s -k borg -p -P foobar | grep sevenofnine
2025-11-21 14:06:32 +01:00
2025-11-21 00:33:11 +01:00
build-gdbm:
when:
event: [push]
image: alpine:latest
commands:
- apk update
2025-11-21 14:06:32 +01:00
- apk add --no-cache bash build-base perl pcre2 pcre2-dev gdbm gdbm-dev pkgconfig meson ninja
2025-11-21 00:33:11 +01:00
- meson setup --reconfigure build
- ninja -C build
- rm -f test.db
- build/dbtool -d test.db -i -k "test" -v "blah blah blah"
- build/dbtool -d test.db -D | grep blah
2025-11-21 14:06:32 +01:00
test-gdbm:
when:
event: [push]
image: alpine:latest
commands:
- apk update
- apk add --no-cache bash build-base pcre2 pcre2-dev gdbm gdbm-dev
- rm -f test.db
# insert keys
- build/dbtool -d test.db -i -k test -v blah
- build/dbtool -d test.db -i -k foo -v bar
# look if the appear in the dump
- build/dbtool -d test.db -D | grep blah
# count 'em
- build/dbtool -d test.db -D | wc -l | grep 2
# search for key
- build/dbtool -d test.db -s -k test
# search for key regex
- build/dbtool -d test.db -S -k 't$'
# remove key
- build/dbtool -d test.db -r -k foo
# count must match
- build/dbtool -d test.db -D | wc -l | grep 1
# modify a key
- build/dbtool -d test.db -u -k test -v modified
# check modified key
- build/dbtool -d test.db -s -k test | grep modified
# use splitting with regex
- echo today:100 | build/dbtool -d test.db -i -f -t '^([^:]*):([^:]*)'
# check if it works
- build/dbtool -d test.db -s -k today | grep 100
# use splitting with regex reverse
- echo today:cold | build/dbtool -d test.db -R -i -f -t '^([^:]*):([^:]*)'
2025-11-21 14:06:32 +01:00
# check if it works
- build/dbtool -d test.db -s -k cold | grep today
# check encryption
- build/dbtool -d test.db -i -k borg -v sevenofnine -p -P foobar
- build/dbtool -d test.db -s -k borg -p -P foobar | grep sevenofnine
2025-11-21 14:06:32 +01:00