flowbber.plugins.sources.git

Git

This source collects information from a (this) local git repository:

  • The repository root path.
  • The current branch.
  • The current revision hash.
  • The (a) tag pointing to the current revision.
  • Name of the author of the current revision.
  • Email of the author of the current revision.
  • Commit message subject of current revision.
  • Commit message body of current revision.
  • Commit date in strict ISO 8601 format.

The directory option can be used to specify a path to a local git repository to get information from. In particular, if your CI system created an out-of-repository build directory you can always get the context of the repository the pipeline definition file is commited to using:

[[sources]]
type = "git"
id = "..."

    [sources.config]
    directory = "{git.root}"
{
    "sources": [
        {
            "type": "git",
            "id": "...",
            "config": {
                "directory": "{git.root}"
            }
        }
    ]
}

Data collected:

{
    "root": "/home/kuralabs/flowbber",
    "branch": "master",
    "rev": "9742e30",
    "tag": "2.0.0",
    "name": "The Author",
    "email": "author@domain.com",
    "subject": "Added a new Git source.",
    "body": "",
    "date": "2017-09-13T01:27:55-06:00"
}

Dependencies:

pip3 install flowbber[git]

Usage:

[[sources]]
type = "git"
id = "..."

    [sources.config]
    directory = "."
{
    "sources": [
        {
            "type": "git",
            "id": "...",
            "config": {
                "directory": "."
            }
        }
    ]
}

directory

Directory to run git from. This can be any subdirectory inside a git repository, not only the root.

  • Default: '.'

  • Optional: True

  • Schema:

    {
        'type': 'string',
        'empty': False,
    }
    
  • Secret: False

Classes

  • GitSource: Main base class to implement a Source.
class flowbber.plugins.sources.git.GitSource(index, type_, id_, optional=False, timeout=None, config=None)

Inheritance

Inheritance diagram of GitSource