Giter Site home page Giter Site logo

versiontag's Introduction

versiontag

Bash command to automate tagging with semantic versioning in a git repository.

Current version: v2.1.3

Features

Allow easy maintenance of semantic versioning in git projects.

Since 1.4.2 supports .semver file writing.

Since 2.0.0 tags are not annotated by default. You must use the option -m or --message to annotate the tag.

Commands

help - Shows a help
current - Shows the last version tag found. If there is none it defaults to v0.0.0
patch - Increases patch version: v1.0.0 -> v1.0.1
minor - Increases minor version (and resets patch): v1.0.5 -> v1.1.0
major - Increases major version (and resets minor and patch): v1.3.4 -> v2.0.0
remove - Removes the last tag in the repository. This command doesn't support the -f|--force option.

Options

-h|--help - Shows help.
-f|--force - Script won't ask for confirmation.
-d|--dry - Executes without perform any change.
-m|--message - Annotates the tag with the message.
-s|--semver - Generates the .semver file.

Installation

  • Copy the script to the place you want. Best in your $PATH.
  • Make it executable if needed.
  • There is no step three, I guess.

If you want to install it on your Linux or Mac OS X machine, use:

sudo curl -L \
https://raw.githubusercontent.com/franiglesias/versiontag/master/versiontag \
-o /usr/local/bin/versiontag \
&& sudo chmod +x /usr/local/bin/versiontag \
&& versiontag help

Tests

Tests should help you to understand how versiontag works and to modify the code without breaking functionality. More tests are coming soon.

Run the tests with the following command.

bash testCases/testAll.sh

Known limitations

You should update your master before running versiontag in order to get the latest tags from the remote repo.

Contributors

Feel free to suggest improvements and ideas.

A big thank you to:

Patrik Kristian:

  • Tests
  • Linux installation instructions
  • Several code improvements

Javier Ferrer

  • Suggested .semver file

Asghar Ghorbani

  • Fixed problem with remove command

Skarev

  • Improve tag sorting

Your name here ;-)

Basic usage

$ versiontag patch|minor|major [-m 'Tag message']

The command will show current and updated version and will prompt you to create the tag in the local version.

After that, it will prompt you to push the tag to remote repository.

That's all.

Examples

Show current version

$ versiontag current

Generate .semver for current version

$ versiontag current --semver

Patch version

$ versiontag patch -m 'Fix broken view'

Force patch version without annotation

$ versiontag --force patch

Minor version with message option

$ versiontag minor --message 'Add Customer filter by email'

Major version

$ versiontag major -m 'Blog module'

Remove last tag

$ versiontag remove

versiontag's People

Contributors

a-ghorbani avatar franiglesias avatar pkristian avatar skarev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

versiontag's Issues

versiontag remove doesn't work

versiontag remove doesn't work as $last is empty at the point removeTag is called.

A solution could be to move getLastTag before "Process command options" or define removeTag as an action like current etc.

Source of truth for versiontag

Given since 1.4.1 we support writing of .semver file, I'm thinking what source of truth should we use to detect last version.

  • Use git tag (the current option)
  • Use the .semver file
  • Look for tags in remote

Suffixed versions

are we considering and making only stable versions (v1.2.3) or even unstable? (v1.2.3-RC3)

Different sets of versions

what about different sets of versions: for example there is one package in more versions lets say:
v2.3.0 and v2.4.0, and you want to create patch v2.3.1

semver generation

I'm thinking that current command could accept --semver option and generate the .semver file with the current version

versiontag current --semver
versiontag current -s

Use Jenkins build number

This URL pattern returns the last build number for a jenkins job. We need authenticated access to reach it.

http://{jenkins-url-job}/lastBuild/buildNumber

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.