Coder Social home page Coder Social logo

gogitver's Introduction

gogitver

gogitver is a tool to determine the semantic version of a project based on keywords used in the commit history. This project draws a lot of inspiration from GitVersion but with the benefit of go's single binary executable. With the work done by go-git the binary produced can run on Linux, Windows, and Mac.

Getting Started

Installing

Snap

snap install gogitver

Binaries

To install download the latest release from the releases page for your machine architecture and place the binary in your path. You can then run the executable while in the path of your project and it should output the current version. You can then use this version to tag container images, helm charts, etc.

Usage

To get this most out of this tool you should be adding keywords to your git commits.

Example: git commit -m "(+semver: breaking) this change adds a breaking change to the public api"

When gogitver sees this commit in the git history it will bump the major version.

The default regex patterns gogitver will use are:

  • Major: \+semver:\s?(breaking|major)
  • Minor: \+semver:\s?(feature|minor)
  • Patch: \+semver:\s?(fix|patch)

However you can override these by providing a settings file .gogitver.yaml that looks like:

major-version-bump-message: '(major|breaking)\(.*\)'
minor-version-bump-message: '(feat|feature|minor)\(.*\)'
patch-version-bump-message: '(patch|fix)\(.*\)'

You can also override the name and location of this file by providing the settings flag gotgitver --settings=./anotherfile.yaml

Development

Requirements

This project requires at least Go 1.11 because it makes use of go modules for dependencies.

Building

To build the project simply run make build which will generate the binaries and put them in the artifacts folder.

Built With

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • go-git for allowing interactions with git to be easy and without dependencies
  • GitVersion for the inspiration
  • Visual Studio Code for just being an all around great editor

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.