Giter Site home page Giter Site logo

git-tags-py's Introduction

git-tags-py

travis

Cut releases from a Git repo,

Designed for continuous deliveryish workflows, where releases are frequent.

Setup

To define a directory as a package that will be recognised by git-tags-py, add a .package file to that directory.

To set a default channel for releases set the environment variable GIT_TAGS_PY_CHANNEL. This can be overriden with the -c flag.

From the command line

Check out the playground tutorial covering intended workflow, that’s probably the easiest way to get to grips with command line usage. The “entrypoint” command is simply tag with two subcommands release to cut new releases and lookup to inspect historic release tags.

release

tag release [-c <channel>] [-m <message>]
            [--force] [--no-remote] [--repo|-r <path>]

lookup

tag lookup [--repo|-r] [--yaml|-y] [--list|-l] <channel> [number]

From a Python script

The lookup and release modules expose the same functionality as the CLI, but return Python data structures instead of printing things to the terminal. If your current working directory is a Git repository, a simple example might look like this:

>>> import tags
>>> repo = tags.git.Repo('.')
>>> release = Release(repo, 'development')
>>> release.changed
{'exec': '302bd6cd55732551cfa071f33159e6a8d989a38d'}
>>> release.unchanged
{'assets/jazzy': 'b3fb93c6dbb28de2585b3b2b786279d1f3f93610',
 'assets/muted': 'b3fb93c6dbb28de2585b3b2b786279d1f3f93610',
 'lib': '0a1be0ae95f18bdccc881dcbc912b2993c95abda'}
>>> release.create_tag()  # write release tag to the repo

Now let's look up the latest release on the development channel:

>>> lookup = tags.lookup.Lookup(repo, 'development')
>>> latest = lookup.latest()
>>> latest.number
4
>>> latest.data
{'body': {'packages': {'changed': {'exec': '302bd6cd55732551cfa071f33159e6a8d989a38d'},
   'unchanged': {'assets/jazzy': 'b3fb93c6dbb28de2585b3b2b786279d1f3f93610',
    'assets/muted': 'b3fb93c6dbb28de2585b3b2b786279d1f3f93610',
    'lib': '0a1be0ae95f18bdccc881dcbc912b2993c95abda'}}},
 'tag': 'release/development/4',
 'tagger_email': 'user@playground',
 'tagger_name': 'playground-user',
 'time': '1435576963',
 'timezone': '+0100'}

Copy pasta 🍝

Watch the magic unfold without typing a thing (depends the excellent pyenv):

git clone [email protected]:bmcorser/git-tags-py.git
cd git-tags-py
pyenv virtualenv 2.7.8 git-tags-py
pyenv activate git-tags-py
python setup.py install
cd test/playground
./init lib exec
tag release -c development -m 'Release me!' -r local
./touch lib
tag release -c development -m 'Big things!' -r local
tag lookup development -r local -y

git-tags-py's People

Contributors

bmcorser avatar

Watchers

 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.