Metadata-Version: 2.0
Name: git-app-version
Version: 0.3.1
Summary: CLI tool to get Git commit informations and store them in a config file
Home-page: https://github.com/csanquer/git-app-version
Author: Charles Sanquer
Author-email: charles.sanquer.pro@gmail.com
License: GPLv3
Keywords: git version commit deploy tools
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Requires-Dist: iso8601
Requires-Dist: pyyaml
Requires-Dist: pytz
Requires-Dist: lxml
Requires-Dist: tzlocal
Provides-Extra: dev
Requires-Dist: check-manifest; extra == 'dev'
Provides-Extra: test
Requires-Dist: coverage; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: mock; extra == 'test'
Requires-Dist: tox; extra == 'test'

Git App Version
===============

.. image:: https://badge.fury.io/py/git-app-version.svg
   :target: https://badge.fury.io/py/git-app-version
.. image:: https://travis-ci.org/csanquer/git-app-version.svg?branch=master
   :target: https://travis-ci.org/csanquer/git-app-version

A CLI tool written in Python to fetch Git commit informations and store
them in an INI/XML/YAML/JSON file.

Typical usecase : when deploying, run this command and import the git
version config file.

Requirements
------------

-  Python 2.7 or >= 3.3
-  python pip package tool

Installation
------------

Just run ::

    pip install git-app-version

Usage
-----

Help
~~~~

To get help ::

    git-app-version -h

Get Commit Informations
~~~~~~~~~~~~~~~~~~~~~~~

To store git commit informations into a json file ::

    cd <my-git-repository>
    # git-app-version -o <output-file-without-extension> -f <file-format>
    git-app-version -o version -f json

This will generate a version.json file in the current directory.

File formats
~~~~~~~~~~~~

-  json :

.. code::

    {
        "commit_date": "2016-03-01T09:33:33+0000",
        "full_commit": "40aaf83894b98898895d478f8b7cc4a866b1d62c",
        "version": "v1.1.0-3-g439e52",
        "commit_timestamp": "1456824813",
        "deploy_date": "2016-03-02T11:33:45+0000",
        "deploy_timestamp": "1456918425",
        "abbrev_commit": "40aaf83"
    }

-  ini :

.. code::

    [app_version]
    commit_date = 2016-03-01T09:33:33+0000
    full_commit = 40aaf83894b98898895d478f8b7cc4a866b1d62c
    version = v1.1.0-3-g439e52
    commit_timestamp = 1456824813
    deploy_date = 2016-03-02T11:33:45+0000
    deploy_timestamp = 1456918425
    abbrev_commit = 40aaf83

-  xml :

.. code::

    <?xml version='1.0' encoding='UTF-8'?>
    <app_version>
      <full_commit>40aaf83894b98898895d478f8b7cc4a866b1d62c</full_commit>
      <commit_timestamp>1456824813</commit_timestamp>
      <abbrev_commit>40aaf83</abbrev_commit>
      <version>v1.1.0-3-g439e52</version>
      <deploy_timestamp>1456918425</deploy_timestamp>
      <commit_date>2016-03-01T09:33:33+0000</commit_date>
      <deploy_date>2016-03-02T11:33:45+0000</deploy_date>
    </app_version>

-  yml :

.. code::

    ---
    'abbrev_commit': '40aaf83'
    'commit_date': '2016-03-01T09:33:33+0000'
    'commit_timestamp': '1456824813'
    'deploy_date': '2016-03-02T11:33:45+0000'
    'deploy_timestamp': '1456918425'
    'full_commit': '40aaf83894b98898895d478f8b7cc4a866b1d62c'
    'version': 'v1.1.0-3-g439e52'

Licensing
---------

Project under GPL v3 License

Copyright (C) 2016 Charles Sanquer


