GithubHelp home page GithubHelp logo

ci-info's Introduction

CI Info

This tool helps extract CI info.

Version: 0.1.0

Why

Adding the CI info useful to identify what was used to build any app. Yet, doing it properly is boring.

How

Your provide a template file and it will take care of writing the final file with the build information.

This makes it completely language agnostic.

Supported CI

The most popular continuous integration services are suported.

Sample config file

The .ci-info.json looks like this:

{
  "$schema": "https://raw.githubusercontent.com/fclairamb/ci-info/main/config-schema.json",
  "version_input_file": {
    "file": "README.md",
    "pattern": "Version: ([0-9.]+)\n"
  },
  "version_input_tag": {
    "pattern": "^v?([0-9.]+)$"
  },
  "template": {
    "input_file": "build.go.tpl",
    "output_file": "build.go"
  },
  "build_info_file": "build.json"
}

Possible template arguments

Argument Sample Description
{{ .Version }} 0.1.0-fix-pr-check-f96a756 The automatically generated version. This is mix of the declared one and the current GIT info.
{{ .CommitHash }} f96a75638b0e1767f969e23f383f4bc75c0e6ba0 The current GIT commit
{{ .CommitHashShort }} f96a756 Short version of a hash
{{ .CommitDate }} 2022-04-23 23:52:13 +0200 The commit's date
{{ .CommitDateClean }} 2022-04-23-2157 The commit's date in a clean format
{{ .CommitBranch }} fix/pr-check The current branch
{{ .CommitBranchClean }} fix-pr-check The commit branch without special chars
{{ .CommitTag }} v0.1.0 The current GIT tag
{{ .CommitRef }} v0.1.0 The current GIT tag or branch
{{ .CommitSmart }} fix-pr-check-f96a756 The current GIT commit described by tag, otherwise branch + hash, otherwise hash
{{ .BuildTime }} 2022-04-23-2210 The build time
{{ .BuildHost }} build-server The build host
{{ .BuildUser }} runner The build user

ci-info's People

Contributors

fclairamb avatar renovate-bot avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.