Preamble - Create the Tools
- git clone ssh://git@bitbucket.renalregistry.nhs.uk:7999/inf/housekeeping.git
- cd housekeeping
- /c/Python36/python -m virtualenv venv
- venv/scripts/activate
There is also a help command - python scripts/rr_git.py --help
Check out the Code
The following command will checkout SiteValidation, Validation, Editor and Merge into the specified folder, along with any direct requirements from their requirements.txt files.
The destination folder must exist but also MUST be empty beforehand - in particular do not checkout the housekeeping folder under it. Also do not add any other sub-folders to it yourself later.
The first command clones all the repositories - including those from the requirements.txt. The second creates a new branch based on a particular tag.
rr_git.py --destination C:/MyWork/UKRR/Y.Y.Y rr_git.py --action branch --tag-label vX.X.X --branch-label Y.Y.Y --destination C:/MyWork/UKRR/Y.Y.Y
Tags should have a 'v' prefix. This is because Git seems to complain if you have a branch and tag with exactly the same name.
The Tag Version vX.X.X should be the latest tag in the Master branch i.e the previous release. While I think this should be okay I think it would be more correct when doing a non-hotfix build to branch from master. I think this requires
Modifying requirements.txt
For each of the checked out components modify requirements.txt so that they're pointing at the new branch.
E.g. in rr_data on the master file, the subcomponents
-e git+ssh://jira.renalregistry.nhs.uk:7999/rr/utils#egg=rr.utils
-e git+ssh://jira.renalregistry.nhs.uk:7999/rr/rr_logging#egg=rr_logging
-e git+ssh://jira.renalregistry.nhs.uk:7999/rr/rr_common#egg=rr_common
Need to be changed to:
-e git+ssh://jira.renalregistry.nhs.uk:7999/rr/utils@Y.Y.Y#egg=rr.utils
-e git+ssh://jira.renalregistry.nhs.uk:7999/rr/rr_logging@Y.Y.Y#egg=rr_logging
-e git+ssh://jira.renalregistry.nhs.uk:7999/rr/rr_common@Y.Y.Y#egg=rr_common
Where Y.Y.Y is the new version number and the name of our branch.
This can be done with the command.
rr_git.py --action update --branch Y.Y.Y --destination C:/Mywork/UKRR/Y.Y.Y --message "Update requirements.txt"
At the moment the above command willl only work if there isn't an existing branch tag in the URLs in the URLs. If there is the Search/Replace will duplicate the tags and things will break.
There shouldn't be any tags in the URls if the Deployment instructions have been followed correctly so you should be able to use the command.
needs to be done for this not to be an issue.
Updating Version Numbers
Update:
- version.txt
- __init__.py
The version should be kept in sync for rr_validation, rr_merge, rr_editor and rr_site_validation.
You will need to commit each repo after the file has been updated.
Adding the Version to Jira
In Jira go to the "Renal Registry" Project and click the Settings ("Cog") button in the lower left hand side.
Go to the Versions section and add a new Version entry for the new version number
Checking out already branched code (for 2nd person to work on branch)
rr_git.py --branch-label Y.Y.Y --destination C:/MyWork/UKRR/Y.Y.Y