Skip to content

oshalygin/go-tag

Repository files navigation

GitHub Logo

Go Git

Automatically tag your repository!

Release Travis Software License Coveralls Code Climate Issue Count Go Report Card GoDoc

Introduction

This is a simple and straightforward CLI utility that automatically tags your repository.

Motivation

Commonly, you'll want to automate your tagging process. As you release features, you'll add a version somewhere within your application, for Node.js projects this is package.json. This whole process is time consuming and repetitive, why not let a utility handle this automatically?

  • Ensuring your repository is properly tagged based on release versions

Currently Supported Frameworks

This is the current state of the utility and what it supports.

Framework File Read Status Examples
Generic VERSION In Progress VERSION
Node.js package.json In Progress package.json

Requirements

Without bloating the utility with a ton of required options, the go-tag utility depends on certain aspects being present in each of your git repositories.

  • You are authorized to push against the repository.
  • All of the credentials are properly configured in your shell.
  • You have one of the files described in the Currently Supported Frameworks. This file lives in the root of where the utility is ran.

Installation

go get -u github.com/oshalygin/go-tag

Usage

Golang Installed

There are numerous ways to consume this library. If you have Golang installed on your machine, you can use the instructions in Installation followed by the following command:

# Call the utility and enjoy the automation!

go-tag

The following is an example of how you would consume this from a CI environment such as Travis.

From CI with Bash

readonly utility_version="1.0.0" # pick the release version you want

# Select the architecture and the OS
# Travis CI is generally configured for the following
# Operating System: linux
# Architecture: amd64
# For more information check out the #select-your-binary section
readonly utility_binary="linux_amd64_go-tag"

# If using wget, provide an output path of where the binary will live
readonly utility="${PWD}/dist/go-tag"

# Retrieve the latest binary
wget https://github.com/oshalygin/go-tag/releases/download/$utility_version/$utility_binary \
      -O $utility

# Update access permissions of the utility
chmod +x $utility

# Usage
sudo $utility

Command Line Arguments

None, this utility is called within the current git repository and it will make the rest happen!

Limitations

This utility depends on you having the right credentials set.

Additionally, this utility only works with Node.js projects(for now), namely projects with a package.json file AND generic version files. Please reference the Currently Supported Frameworks section for supported frameworks.

More frameworks are coming, so if you see something that isn't supported, post an Issue!

Select The Right Binary

If you're pulling down the binary manually, you'll need to match it to your OS and the instruction set. Thankfully, if you pulled it via Go, the proper $GOOS(Operating System) and $GOARCH are set for you.

For exciting bathroom reading checkout the Go documentation for compilation architecture descriptions and overriding defaults. Go Documentation

License

MIT

About

Your dirt simple Git Tagging utility. Stop writing bash scripts today!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages