add: build info to db and cache

This commit is contained in:
Wataru Otsubo 2025-01-27 18:49:19 +09:00
parent c122912fe8
commit ecf849ae8a
2 changed files with 4 additions and 3 deletions

View file

@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `create_database`(formally `create_database_from_exported_csvs`) now can save a JLD2 cache to store parsed slave logs.
- Docs: add index page for published notebooks
- Added converter git version info (`git describe --dirty`) to the database and JLD2 cache.
- Added converter git version info (`git describe --dirty`) and build datetime info to the database and JLD2 cache.
### Changed

View file

@ -13,17 +13,18 @@ function insert_version_info(db::SQLite.DB, jld2_slavelog::JLD2.JLDFile)
""",
)
converter_git_describe = try
read(`git describe --dirty`, String)
read(`git describe --dirty`, String) |> chomp
catch e
@warn "Failed to get git describe: $e"
""
end
@info "converter version info" converter = pkgversion(@__MODULE__) |> string converter_git_describe
datetime = round(Int64, datetime2unix(now())) |> string
DBInterface.execute(
stmt_insert_version,
(;
converter = pkgversion(@__MODULE__) |> string,
converter_git = converter_git_describe,
converter_git = converter_git_describe * '+' * datetime,
),
)
jld2_slavelog["meta"] = converter_git_describe