Package: easy-workflow-manager
InstallInstall withpip% pip3 install easy-workflow-managerAfter 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 = masterUnderstandingTo understand how you might make use of this project, check out some of
the test helper functions and test code, then the scriptstests/__init__.pyoverrwites some settings forQA_BRANCHESandSOURCE_BRANCHand defines several functions that executegitcommands, with the help ofbg_helper.runmake_fileto create a file usingechoand output
redirectionappend_to_fileto append to a file usingechoand output
redirectionchange_file_lineto change a line of a file usingsedinit_clone_cd_repoto create a git repo atremote_path,
clone it tolocal_path, and cd tolocal_pathalso creates a file, commits it, and pushes to origincheckout_branchto checkout an existing branchadd_commit_pushto add modified files, commit, and pushdeploy_merge_tagto deploy a branch to an open qa environment,
merge back to source, then tagthis makes heavy use of some high-leveleasy_workflow_managerfunctionsget_empty_qaget_remote_branchesdeploy_to_qaget_qa_env_branchesmerge_qa_to_sourcetag_releaseget_tag_messagetests/conftest.pydefines a single “fixture” that creates a new
folder in/tmpto contain a new “remote git repository” and its
“local clone” per defined test classthe fixture yields to let the methods of the test class run before
deleting the temporary datathis would be a good place to drop apytest.set_trace()if
you want to inspect temporary repos and their commitstests/test_stuff.pydefines two test classes with some test
methodsTestNewRepo.test_remote_branchesto make sure the only remote
branch ismaster, create 3 new branches, confirm that various
invocations ofewm.get_remote_branches()return what you’d
expectTestNewRepo.test_local_branchesto confirm that various
invocations ofewm.get_local_branches()return what you’d
expectTestNewRepo.test_qato confirm that no qa branches are in use
and thatewm.get_empty_qa()returns the set of the overwrittenQA_BRANCHES, then use the helper functions to append to a
file, commit the changes, push to the remotethen check thatewm.deploy_to_qa()gets the specified
branch(es) onto the specified qa branchthen check thatewm.clear_qa()clears the specified qa
branchTestNewRepo.test_change_commit_push()to update a filethen check thatewm.get_merged_remote_branches()does not
include the branch that was just updatedTestNewRepo.test_tagging()to check that merging a branch to
source and tagging it worksCommands / 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 TestsClone this repo then run the./dev-setup.bashscript to create a
virtual environment that includespytest% ./dev-setup.bashRun pytest with the-van-soptions to tests invoked as well as
all the generatedgitcommands and their output% venv/bin/pytest -vsResourceshttps://git-scm.com/book/en/v2