Extremely simple KV storage with app versions created for use in linux console
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vladimir Smagin 84cd7cbfd7 add combined and ts 2 months ago
build/deb build in jenkins 2 months ago
vendor vendor 2 months ago
.gitignore readme 2 months ago
Jenkinsfile - 2 months ago
example-bash-script.sh readme 2 months ago
go.mod import 2 months ago
go.sum import 2 months ago
main.go add combined and ts 2 months ago
readme.md add combined and ts 2 months ago
versions.db import 2 months ago



Simple KV storage to manage app versions in your bash scripts.

Requred parametes: -action and -app

Parameter -version is required for set action.

Version number and unix timestamp (time of last version update) will be returned in get action.

Usage of ./versions-db:
  -action string
        Action: get, set, ts or combined (required)
  -app string
        Application name (required)
  -dbfile string
        Path to database file (required)
  -version string
        Version name (required in set action)

Sample run

vlad@turtle:~/$ versions-db -dbfile ./versions.db -action set -app test -version 0.4
vlad@turtle:~/$ versions-db -dbfile ./versions.db -action get -app test

Use in bash script


IFS=";" read -ra VER <<< "$(versions-db -dbfile ./versions.db -action combined -app test)"
echo  "Version: ${VER[0]}"
echo  "Updated: $(date -d @${VER[1]})"


vlad@turtle:~/$ ./example-bash-script.sh 
Version: 0.4
Updated: Пт 23 окт 2020 06:49:38 +07