A small utility for generating buildstamp
file, which contains various build info like timestamp, repo name, git commit and so on. This file could be a part of some release artifact (npm-package, docker-image) and makes it self-descriptive.
{
"date": "2020-11-05T15:16:35.904Z",
"docker_image_tag": "foo",
"git_commit_id": "007b8f715eb5670662d90f90cd1916398d1dfe98",
"git_rep_url": "https://github.com/qiwi/buildstamp.git",
"git_repo_name": "qiwi/buildstamp"
}
import {buildstamp} from '@qiwi/buildstamp'
await buildstamp({
output: 'buildstamp.json', // filepath or `console` or `false` to disable
git: true, // to capture git digest
ci: true, // to collect basic CICD info
date: true, // to attach the current iso8601 date
extra: { // Object.assign mixin
foo: 'bar'
}
})
// returns a plain object, so you're able to process it in any way
There are a pair of options: with or w/o Node.js on board.
npx buildstamp --output='buildstamp.json'
# fetch and call golang-ported binary
curl 'https://github.com/qiwi/buildstamp/releases/download/2023.6.27-qiwi.buildstamp-bin.1.0.2-f0/buildstamp-darwin-amd64.tar.gz' | tar -xvz --strip-components=1 -С . && ./buildstamp && rm ./buildstamp