CLI tool to get Git commit informations and store them in a config file
Project description
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
{ "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
[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
<?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
--- '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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
git-app-version-0.3.1.tar.gz
(6.4 kB
view hashes)
Built Distribution
Close
Hashes for git_app_version-0.3.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b68f9be873b3d550519519969bf3aff0cb37d4feb389bf9457fc1f988e61d20f |
|
MD5 | 5c897a941c42e6043fcac00eab610404 |
|
BLAKE2b-256 | 92d6fd684bce97cb7ff84443cfae67d68724c38aab667b13508b378cf1d3a5c0 |