Install
-------
Install with ``pip``
::
% pip3 install easy-workflow-manager
After running for the first time, the default settings file is copied to
``~/.config/easy-workflow-manager/settings.ini``
::
[default]
QA_BRANCHES = qa, qa2, qa3, qa4
IGNORE_BRANCHES = master, develop, release, uat
LOCAL_BRANCH = mylocalprep
SOURCE_BRANCH = master
Understanding
-------------
To understand how you might make use of this project, check out some of
the test helper functions and test code, then the scripts
- ``tests/__init__.py`` overrwites some settings for ``QA_BRANCHES``
and ``SOURCE_BRANCH`` and defines several functions that execute
``git`` commands, with the help of ``bg_helper.run``
- ``make_file`` to create a file using ``echo`` and output
redirection
- ``append_to_file`` to append to a file using ``echo`` and output
redirection
- ``change_file_line`` to change a line of a file using ``sed``
- ``init_clone_cd_repo`` to create a git repo at ``remote_path``,
clone it to ``local_path``, and cd to ``local_path``
- also creates a file, commits it, and pushes to origin
- ``checkout_branch`` to checkout an existing branch
- ``add_commit_push`` to add modified files, commit, and push
- ``deploy_merge_tag`` to deploy a branch to an open qa environment,
merge back to source, then tag
- this makes heavy use of some high-level
``easy_workflow_manager`` functions
- ``get_empty_qa``
- ``get_remote_branches``
- ``deploy_to_qa``
- ``get_qa_env_branches``
- ``merge_qa_to_source``
- ``tag_release``
- ``get_tag_message``
- ``tests/conftest.py`` defines a single “fixture” that creates a new
folder in ``/tmp`` to contain a new “remote git repository” and its
“local clone” per defined test class
- the fixture yields to let the methods of the test class run before
deleting the temporary data
- this would be a good place to drop a ``pytest.set_trace()`` if
you want to inspect temporary repos and their commits
- ``tests/test_stuff.py`` defines two test classes with some test
methods
- ``TestNewRepo.test_remote_branches`` to make sure the only remote
branch is ``master``, create 3 new branches, confirm that various
invocations of ``ewm.get_remote_branches()`` return what you’d
expect
- ``TestNewRepo.test_local_branches`` to confirm that various
invocations of ``ewm.get_local_branches()`` return what you’d
expect
- ``TestNewRepo.test_qa`` to confirm that no qa branches are in use
and that ``ewm.get_empty_qa()`` returns the set of the overwritten
``QA_BRANCHES``, then use the helper functions to append to a
file, commit the changes, push to the remote
- then check that ``ewm.deploy_to_qa()`` gets the specified
branch(es) onto the specified qa branch
- then check that ``ewm.clear_qa()`` clears the specified qa
branch
- ``TestNewRepo.test_change_commit_push()`` to update a file
- then check that ``ewm.get_merged_remote_branches()`` does not
include the branch that was just updated
- ``TestNewRepo.test_tagging()`` to check that merging a branch to
source and tagging it works
Commands / scripts
------------------
::
$ venv/bin/ewm-new-branch-from-source --help
Usage: ewm-new-branch-from-source [OPTIONS] [NAME]
Create a new branch from SOURCE_BRANCH on origin
Options:
--help Show this message and exit.
$ venv/bin/ewm-deploy-to-qa --help
Usage: ewm-deploy-to-qa [OPTIONS] [QA]
Select remote branch(es) to deploy to specified QA branch
Options:
-g, --grep TEXT case-insensitive grep pattern to filter branch names by
--help Show this message and exit.
$ venv/bin/ewm-qa-to-source --help
Usage: ewm-qa-to-source [OPTIONS] [QA]
Merge the QA-verified code to SOURCE_BRANCH and delete merged branch(es)
Options:
--help Show this message and exit.
$ venv/bin/ewm-show-qa --help
Usage: ewm-show-qa [OPTIONS] [QA]
Show what is in a specific (or all) qa branch(es)
Options:
-a, --all Select all qa environments
--help Show this message and exit.
$ venv/bin/ewm-clear-qa --help
Usage: ewm-clear-qa [OPTIONS] [QA]
Clear whatever is in a specific (or all) qa branch(es)
Options:
-a, --all Select all qa environments
--help Show this message and exit.
$ venv/bin/ewm-tag-release --help
Usage: ewm-tag-release [OPTIONS]
Select a recent remote commit on SOURCE_BRANCH to tag
Options:
--help Show this message and exit.
Running Tests
-------------
Clone this repo then run the ``./dev-setup.bash`` script to create a
virtual environment that includes ``pytest``
::
% ./dev-setup.bash
Run pytest with the ``-v`` an ``-s`` options to tests invoked as well as
all the generated ``git`` commands and their output
::
% venv/bin/pytest -vs
Resources
---------
- https://git-scm.com/book/en/v2
Raw data
{
"_id": null,
"home_page": "https://github.com/kenjyco/easy-workflow-manager",
"name": "easy-workflow-manager",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "git,workflow,cli,command-line,branch,merge,qa,deploy,helper,kenjyco",
"author": "Ken",
"author_email": "kenjyco@gmail.com",
"download_url": "https://github.com/kenjyco/easy-workflow-manager/tarball/v0.0.14",
"platform": null,
"description": "Install\n-------\n\nInstall with ``pip``\n\n::\n\n % pip3 install easy-workflow-manager\n\nAfter running for the first time, the default settings file is copied to\n``~/.config/easy-workflow-manager/settings.ini``\n\n::\n\n [default]\n QA_BRANCHES = qa, qa2, qa3, qa4\n IGNORE_BRANCHES = master, develop, release, uat\n LOCAL_BRANCH = mylocalprep\n SOURCE_BRANCH = master\n\nUnderstanding\n-------------\n\nTo understand how you might make use of this project, check out some of\nthe test helper functions and test code, then the scripts\n\n- ``tests/__init__.py`` overrwites some settings for ``QA_BRANCHES``\n and ``SOURCE_BRANCH`` and defines several functions that execute\n ``git`` commands, with the help of ``bg_helper.run``\n\n - ``make_file`` to create a file using ``echo`` and output\n redirection\n - ``append_to_file`` to append to a file using ``echo`` and output\n redirection\n - ``change_file_line`` to change a line of a file using ``sed``\n - ``init_clone_cd_repo`` to create a git repo at ``remote_path``,\n clone it to ``local_path``, and cd to ``local_path``\n\n - also creates a file, commits it, and pushes to origin\n\n - ``checkout_branch`` to checkout an existing branch\n - ``add_commit_push`` to add modified files, commit, and push\n - ``deploy_merge_tag`` to deploy a branch to an open qa environment,\n merge back to source, then tag\n\n - this makes heavy use of some high-level\n ``easy_workflow_manager`` functions\n\n - ``get_empty_qa``\n - ``get_remote_branches``\n - ``deploy_to_qa``\n - ``get_qa_env_branches``\n - ``merge_qa_to_source``\n - ``tag_release``\n - ``get_tag_message``\n\n- ``tests/conftest.py`` defines a single \u201cfixture\u201d that creates a new\n folder in ``/tmp`` to contain a new \u201cremote git repository\u201d and its\n \u201clocal clone\u201d per defined test class\n\n - the fixture yields to let the methods of the test class run before\n deleting the temporary data\n\n - this would be a good place to drop a ``pytest.set_trace()`` if\n you want to inspect temporary repos and their commits\n\n- ``tests/test_stuff.py`` defines two test classes with some test\n methods\n\n - ``TestNewRepo.test_remote_branches`` to make sure the only remote\n branch is ``master``, create 3 new branches, confirm that various\n invocations of ``ewm.get_remote_branches()`` return what you\u2019d\n expect\n - ``TestNewRepo.test_local_branches`` to confirm that various\n invocations of ``ewm.get_local_branches()`` return what you\u2019d\n expect\n - ``TestNewRepo.test_qa`` to confirm that no qa branches are in use\n and that ``ewm.get_empty_qa()`` returns the set of the overwritten\n ``QA_BRANCHES``, then use the helper functions to append to a\n file, commit the changes, push to the remote\n\n - then check that ``ewm.deploy_to_qa()`` gets the specified\n branch(es) onto the specified qa branch\n - then check that ``ewm.clear_qa()`` clears the specified qa\n branch\n\n - ``TestNewRepo.test_change_commit_push()`` to update a file\n\n - then check that ``ewm.get_merged_remote_branches()`` does not\n include the branch that was just updated\n\n - ``TestNewRepo.test_tagging()`` to check that merging a branch to\n source and tagging it works\n\nCommands / scripts\n------------------\n\n::\n\n $ venv/bin/ewm-new-branch-from-source --help\n Usage: ewm-new-branch-from-source [OPTIONS] [NAME]\n\n Create a new branch from SOURCE_BRANCH on origin\n\n Options:\n --help Show this message and exit.\n\n\n $ venv/bin/ewm-deploy-to-qa --help\n Usage: ewm-deploy-to-qa [OPTIONS] [QA]\n\n Select remote branch(es) to deploy to specified QA branch\n\n Options:\n -g, --grep TEXT case-insensitive grep pattern to filter branch names by\n --help Show this message and exit.\n\n\n $ venv/bin/ewm-qa-to-source --help\n Usage: ewm-qa-to-source [OPTIONS] [QA]\n\n Merge the QA-verified code to SOURCE_BRANCH and delete merged branch(es)\n\n Options:\n --help Show this message and exit.\n\n\n $ venv/bin/ewm-show-qa --help\n Usage: ewm-show-qa [OPTIONS] [QA]\n\n Show what is in a specific (or all) qa branch(es)\n\n Options:\n -a, --all Select all qa environments\n --help Show this message and exit.\n\n\n $ venv/bin/ewm-clear-qa --help\n Usage: ewm-clear-qa [OPTIONS] [QA]\n\n Clear whatever is in a specific (or all) qa branch(es)\n\n Options:\n -a, --all Select all qa environments\n --help Show this message and exit.\n\n\n $ venv/bin/ewm-tag-release --help\n Usage: ewm-tag-release [OPTIONS]\n\n Select a recent remote commit on SOURCE_BRANCH to tag\n\n Options:\n --help Show this message and exit.\n\nRunning Tests\n-------------\n\nClone this repo then run the ``./dev-setup.bash`` script to create a\nvirtual environment that includes ``pytest``\n\n::\n\n % ./dev-setup.bash\n\nRun pytest with the ``-v`` an ``-s`` options to tests invoked as well as\nall the generated ``git`` commands and their output\n\n::\n\n % venv/bin/pytest -vs\n\nResources\n---------\n\n- https://git-scm.com/book/en/v2\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Tools to support a straightforward branch/qa/merge/release process",
"version": "0.0.14",
"project_urls": {
"Download": "https://github.com/kenjyco/easy-workflow-manager/tarball/v0.0.14",
"Homepage": "https://github.com/kenjyco/easy-workflow-manager"
},
"split_keywords": [
"git",
"workflow",
"cli",
"command-line",
"branch",
"merge",
"qa",
"deploy",
"helper",
"kenjyco"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fa6dad38a764d969278e78ee2d6a27370c0ef0847155b531449510cb0a0dc685",
"md5": "4162efa7909efc7951a1bae74f7a8b1d",
"sha256": "c32abf44f53a9c722e2b49aab8416034d302867aea8dd498f5fb5648ad89bee6"
},
"downloads": -1,
"filename": "easy_workflow_manager-0.0.14-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4162efa7909efc7951a1bae74f7a8b1d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 19930,
"upload_time": "2023-07-10T04:33:18",
"upload_time_iso_8601": "2023-07-10T04:33:18.507718Z",
"url": "https://files.pythonhosted.org/packages/fa/6d/ad38a764d969278e78ee2d6a27370c0ef0847155b531449510cb0a0dc685/easy_workflow_manager-0.0.14-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-10 04:33:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kenjyco",
"github_project": "easy-workflow-manager",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "bg-helper",
"specs": []
},
{
"name": "click",
"specs": [
[
">=",
"6.0"
]
]
},
{
"name": "dt-helper",
"specs": []
},
{
"name": "input-helper",
"specs": []
},
{
"name": "settings-helper",
"specs": []
}
],
"lcname": "easy-workflow-manager"
}