Skip to content

qiwi/buildstamp

Repository files navigation

buildstamp

CI Test Coverage Maintainability

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) to make it self-descriptive.

{
  "date":               "2020-11-05T15:16:35.904Z",
  "docker_image_tag":   "foo",
  "git_commit_id":      "007b8f715eb5670662d90f90cd1916398d1dfe98",
  "git_commit_branch":  "master",
  "git_repo_url":       "https://github.com/qiwi/buildstamp.git",
  "git_repo_name":      "qiwi/buildstamp"
}

Usage

JS/TS API

import {buildstamp} from '@qiwi/buildstamp'

await buildstamp({
  output: 'buildstamp.json',  // filepath 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

CLI

There are several options with or w/o Node.js on board.

npx

npx buildstamp --output='buildstamp.json'

binary

# 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

bash

# invoke poor but pure bash implementation
curl "https://raw.githubusercontent.com/qiwi/buildstamp/master/packages/bash/src/main/sh/buildstamp.sh" | sh

Contents

Package Description Latest
@qiwi/buildstamp-bash Buildstamp rewritten in bash
@qiwi/buildstamp-bin Platform-specific Buildstamp binaries
@qiwi/buildstamp-infra Buildstamp monorepo infra assets
buildstamp Buildstamp JS/TS API npm (scoped)

License

MIT