{ "info": { "author": "Steinwurf ApS", "author_email": "contact@steinwurf.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Plugins", "Environment :: Web Environment", "Framework :: Sphinx :: Extension", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Documentation", "Topic :: Documentation :: Sphinx", "Topic :: Software Development :: Documentation", "Topic :: Text Processing", "Topic :: Utilities" ], "description": "Introduction\n============\n\n.. image:: https://ci.appveyor.com/api/projects/status/mld0fa79ox939fex/branch/master?svg=true\n :target: https://ci.appveyor.com/project/SteinwurfApS/giit\n\n.. image:: https://travis-ci.org/steinwurf/giit.svg?branch=master\n :target: https://travis-ci.org/steinwurf/giit\n\nThe Git Iterator ``giit`` is a small tool for running commands on\nbranches and tags of a git repository.\n\nIt's original purpose was to allow Sphinx documentation to be easily\ngenerated for all available tags of a bunch of repositories. However,\nshould you find an use for it - you should also be able to adapt it\nto other scenarios.\n\nQuick Start\n===========\n\nTo use ``giit`` you define a ``giit.json`` file which contains the steps\nyou want ``giit`` to be able to run. Note, the ``giit.json`` file can\nlive in the root of the repository.\n\nLet's say we want to generate the Sphinx documentation for a specific\nrepository.\n\nExample: ``urllib3``\n--------------------\n\n``giit`` uses a ``giit.json`` file to describe the different steps::\n\n {\n \"docs\": {\n \"type\": \"python\",\n \"scripts\": [\n \"sphinx-build -b html . ${build_path}\"\n ],\n \"cwd\": \"${source_path}/docs\",\n \"requirements\": \"${source_path}/docs/requirements.txt\"\n }\n }\n\nLets build the ``urllib3`` Sphinx documentation\n(https://urllib3.readthedocs.io/en/latest/) by running ``giit``::\n\n giit docs https://github.com/urllib3/urllib3.git --json_config ./giit.json\n\nYou should now seem something like::\n\n Lets go!\n Using git repository: https://github.com/urllib3/urllib3.git\n Running: git clone in /tmp/giit/data/clones/urllib3-b1919a\n Building into: /tmp/giit/build/urllib3-b1919a\n Python: sphinx-build -b html . /tmp/giit/build/urllib3-b1919a\n\n\n\n\n``giit.json``\n=============\n\nThe ``giit.json`` is where the different steps are defined. Let's\nwalk though the different attributes which can be used.\n\nDefining steps\n--------------\n\nThe different steps define the behavior we can invoke, in\nthe following ``giit.json`` we define three steps::\n\n {\n \"docs\": {\n ...\n },\n \"landing_page\": {\n ...\n },\n \"publish\": {\n ...\n }\n }\n\nStep type\n----------\n\nEach step will have a type. The type defines the behavior and\nattributes available in the step.\n\nCurrently supported are ``python`` and ``sftp``\n\nStep scope\n----------\n\nIf enabled a step will run in a number of different \"scopes\":\n\n* ``workingtree``:\n * If a user passes a path to the ``giit`` command e.g.\n ``giit docs ../dev/project/docs`` then the ``workingtree`` scope will\n be enabled.\n * The step will run once with the variable ``source_path`` set to\n local path.\n * This allows a user to run steps without having to first\n push to the remote git repository.\n* ``branch``:\n * The source branch scope will default to ``master``.\n * If a user passes a path to ``giit`` the source branch will be whatever\n branch the local repository is on.\n * The source branch can also be selected by the user when passing\n a git URL to the ``giit`` command.\n* ``tag``:\n * A default ``giit`` will run the step for each tag on the repository\n in this scope.\n\nAs a default all steps default to only run in the ``branch``\nscope. This can be change with the ``scope`` step attribute.\n\nStep built-in variables\n-----------------------\n\nWhen defining a step ``giit`` makes a number of variables available.\n\nAs an example in the following we can customize the output location\nof ``sphinx-build`` like this::\n\n {\n \"docs\": {\n \"type\": \"python\",\n \"scripts\": [\n \"sphinx-build -b html . ${build_path}\"\n ]\n ...\n }\n ...\n }\n\nIn the above ``${build_path}`` will be substituted for the default\n``giit`` build path or a user specified one.\n\nThe following built-in variables are available:\n\n* ``build_path``: The path where the produced output should go.\n* ``source_path``: The path to the repository\n* ``name``: Identifier depending on the scope e.g. branch name or\n tag name.\n* ``scope``: The scope we are in.\n\nStep user variables\n--------------------\n\nThe user can define variables using the ``variables`` attribute.\nUser variables are define using the following syntax::\n\n scope:remote_branch:variable_name\n\nWhere ``scope`` and ``remote_branch`` are optional.\n\nThis can be used to customize e.g. the ``build_path``. Consider\nthe following example::\n\n {\n \"sphinx\": {\n \"type\": \"python\",\n \"scripts\": [\n \"sphinx-build -b html . ${output_path}\"\n ],\n ...\n \"variables\": {\n \"branch:origin/master:output_path\": \"${build_path}/docs/latest\",\n \"branch:output_path\": \"${build_path}/sphinx/${name}\",\n \"tag:output_path\": \"${build_path}/docs/${name}\",\n \"workingtree:output_path\": \"${build_path}/workingtree/sphinx\"\n }\n }\n }\n\nWhen calling ``sphinx-build`` we use the user defined ``output_path``\nvariable.\n\nLet walk though the different values ``output_path`` can take.\n\n* If scope is ``branch`` and the branch is ``origin/master`` then\n ``output_path`` will be ``${build_path}/docs/latest``.\n* For all other branches ``output_path`` will be\n ``${build_path}/sphinx/${name}`` where ``${name}`` will be the\n branch name.\n* For the tags ``output_path`` will be ``${build_path}/docs/${name}``\n where name is the tag value e.g. ``1.0.0`` etc.\n* Finally if we are in the ``workingtree`` scope the ``output_path``\n variable will be ``${build_path}/workingtree/sphinx``\n\nLets see how this could look (``build_path`` is ``/tmp/project``)::\n\n Tag 1.0.0 -----------> /tmp/project/docs/1.0.0\n Tag 1.0.0 -----------> /tmp/project/docs/2.0.0\n Tag 1.0.0 -----------> /tmp/project/docs/2.1.0\n Tag 1.0.0 -----------> /tmp/project/docs/3.0.0\n Branch master -------> /tmp/project/docs/latest\n Branch trying_new ---> /tmp/project/sphinx/trying_new\n Branch new_idea -----> /tmp/project/sphinx/new_idea\n Workingtree ---------> /tmp/project/workingtree\n\n``clean`` step\n..............\n\nThe ``clean`` step just remove the ``build_path``.\n\n``python`` step\n...............\n\nThe ``python`` step supports the following attributes:\n\n* Mandatory ``scripts``: A list of commands to execute\n* Optional ``cwd``: The path where commands will be executed\n* Optional ``requirements``: Path to a ``pip`` requirements file containing\n dependencies to be installed. If specified a virtualenv will\n created.\n* Optional ``pip_packages``: A list of ``pip`` packages to install. If\n specified a virtualenv will created.\n* Optional ``scope``: A list of ``scope`` names for which the step will run.\n* Optional ``allow_failure``: A boolean indicating whether we\n allow the scripts to fail.\n\n``giit`` command line arguments\n===============================\n\nThe ``giit`` tool takes two mandatory arguments and a number of options::\n\n giit STEP REPOSITORY [--options]\n\nArgument: ``STEP``\n-----------------\n\nSelects the step in the ``giit.json`` file to run.\n\nArgument: ``REPOSITORY``\n------------------------\n\nThe URL or path to the git repository.\n\nOption: ``--build_path``\n-----------------------\n\nSets the build path (i.e. where the output artifacts/data) will be generated/\nbuilt. This argument is available in the ``giit.json`` as the ``${build_path}``\nvariable.\n\nOption: ``--data_path``\n-----------------------\n\nThis path is where the ``giit`` tool will store configurations, virtualenvs\nclones created while running the tool. It also serves as a cache, to speed up\nbuilds.\n\nOption: ``--remote_branch``\n---------------------------\n\nSpecifies the source branch to use. The default is ``origin/master``, however if you\nneed to build a different branch this is one way of doing it.\n\nOption: ``--json_config``\n-------------------------\n\nSets the path to where the ``giit.json`` file.\n\n\n\n\nFactories and Dependency Injection\n----------------------------------\n\nTestability is a key feature of any modern software library and one of the key\ntechniques for writing testable code is dependency injection (DI).\n\nIn Python DI is relatively simple to implement due to the dynamic nature of the\nlanguage.\n\nGit branches\n------------\n\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/steinwurf/", "keywords": "giit", "license": "BSD 3-clause \"New\" or \"Revised\" License", "maintainer": "", "maintainer_email": "", "name": "giit", "package_url": "https://pypi.org/project/giit/", "platform": "", "project_url": "https://pypi.org/project/giit/", "project_urls": { "Homepage": "https://github.com/steinwurf/" }, "release_url": "https://pypi.org/project/giit/3.0.0/", "requires_dist": [ "click", "paramiko", "semantic-version" ], "requires_python": "", "summary": "Wrapper git to automate running scripts.", "version": "3.0.0" }, "last_serial": 4015196, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "bd26182210b8507067722c8674d8826a", "sha256": "d8d20f8e12a731474dc6da2b93131a2eea4131090bfe8f8bdbaa5daa9af20d79" }, "downloads": -1, "filename": "giit-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bd26182210b8507067722c8674d8826a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27091, "upload_time": "2018-06-26T07:37:23", "url": "https://files.pythonhosted.org/packages/d3/15/339c33a400d6338bd164b3558cdcd696162127ea3f97b52e8b8af1051ed6/giit-1.0.0-py2.py3-none-any.whl" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "65a8aec69ee656dee0cc7b6a9a4a6e49", "sha256": "688f7ea2f0a98c5d00bf4df49e3de7f47447ac4988956264d00032e47fc9cc5c" }, "downloads": -1, "filename": "giit-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "65a8aec69ee656dee0cc7b6a9a4a6e49", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27170, "upload_time": "2018-06-26T10:17:11", "url": "https://files.pythonhosted.org/packages/94/a7/c416210e8100b5070c89997d1dec0de91cede9974c0fa04bea2d3beeb49c/giit-1.0.1-py2.py3-none-any.whl" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "1ef490b3948b02ca87091a72b9f56291", "sha256": "3b033c03e5f7d35eb2c575a6acbcd9a27e6a63f36a572e7b472c4287c9af43b6" }, "downloads": -1, "filename": "giit-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1ef490b3948b02ca87091a72b9f56291", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27167, "upload_time": "2018-06-26T11:36:19", "url": "https://files.pythonhosted.org/packages/fe/a6/390e70bb881ee26fe3b8a81f3e54b8e5c858d6cd5d87257ae803a8a810c6/giit-1.0.2-py2.py3-none-any.whl" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "cf36ebfc529de8c9bc933c30965efa15", "sha256": "eb1641661ce899aaa60f0153271a48197f80814fd4a31d3791482889ed9bb59c" }, "downloads": -1, "filename": "giit-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "cf36ebfc529de8c9bc933c30965efa15", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27220, "upload_time": "2018-06-26T14:49:24", "url": "https://files.pythonhosted.org/packages/54/9d/3aec83cbfc0fe27638712eb11b8a6e09b1f1a1b09abb6198dd71ea6e9923/giit-1.0.3-py2.py3-none-any.whl" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "4e6d818dae145ff125e56f6de565764f", "sha256": "e3533dd8226cf09b8a7db3cc628acd6087c5541a7bc8e7b6cd07a11cff4540d3" }, "downloads": -1, "filename": "giit-2.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4e6d818dae145ff125e56f6de565764f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27684, "upload_time": "2018-06-27T10:14:20", "url": "https://files.pythonhosted.org/packages/ce/05/5e936080f39af10c2d5764ca91c328b1f44dd5d26b77235bd0c117f86e9b/giit-2.0.0-py2.py3-none-any.whl" } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "b773f5c1aa4c03d2f71e494add9cbfb0", "sha256": "2ef39b390086238bf1338b664a5318872fb77f8b442e5c34cfbcdbe4c892a8df" }, "downloads": -1, "filename": "giit-2.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b773f5c1aa4c03d2f71e494add9cbfb0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 28152, "upload_time": "2018-06-27T13:24:38", "url": "https://files.pythonhosted.org/packages/7e/e1/9ccdc6cdfe77fc4ebe560ecf48a9c06726ae30ef72e79a0ff3a57a2e0445/giit-2.1.0-py2.py3-none-any.whl" } ], "3.0.0": [ { "comment_text": "", "digests": { "md5": "55064a9c4a2ff74c896e57cf8a32d75e", "sha256": "8017617e8dd8362c86a6bbcca190a45a7915ecba5cb6061511fa2cb48f03e3b5" }, "downloads": -1, "filename": "giit-3.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "55064a9c4a2ff74c896e57cf8a32d75e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 28612, "upload_time": "2018-06-29T12:28:28", "url": "https://files.pythonhosted.org/packages/6c/b7/f2cec9339dc5120ceb450e83ba4d91405bcd95f70913b4e4e538ad53a0e1/giit-3.0.0-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "55064a9c4a2ff74c896e57cf8a32d75e", "sha256": "8017617e8dd8362c86a6bbcca190a45a7915ecba5cb6061511fa2cb48f03e3b5" }, "downloads": -1, "filename": "giit-3.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "55064a9c4a2ff74c896e57cf8a32d75e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 28612, "upload_time": "2018-06-29T12:28:28", "url": "https://files.pythonhosted.org/packages/6c/b7/f2cec9339dc5120ceb450e83ba4d91405bcd95f70913b4e4e538ad53a0e1/giit-3.0.0-py2.py3-none-any.whl" } ] }