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
Tagging
Bamboo uses branches to build - and the recommended way is to branch on a tag. Go to the housekeeping clone you create and run
python scripts/rr_git.py --action tag --tag-label vX.X.X.--destination ~/tmp
will clone and tag all the main products and their components. We do this because they share components. It uses the requirements file to get the sub-components.
The destination folder should be empty beforehand (in particular don't have the housekeeping folder in it)
Branching
Run
python scripts/rr_git.py --action branch --tag-label vX.X.X --branch-label X.X.X --destination ~/tmp
Git, or at least the version of Git on my PC breaks if a tag and branch exist with the same names. I am trying to prefix the tag with a 'v'.
Will branch all the products.
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@1.0.14#egg=rr.utils
-e git+ssh://jira.renalregistry.nhs.uk:7999/rr/rr_logging@1.0.14#egg=rr_logging
-e git+ssh://jira.renalregistry.nhs.uk:7999/rr/rr_common@1.0.14#egg=rr_common
for branch 1.0.14
In the branching step, all the components that are needed to be changed will have been cloned in the destination folder so finding the requirements.txt files to be changed will be easy.
There appears to be a command -
python c:\temp\housekeeping\scripts\rr_git.py --action update --branch 1.1.10 --destination ~/tmp --message "Update requirements.txt"
to do the above automatically, however it doesn't work correctly - particularly if the requirements.txt already contains a branch tag.
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.
Checking out branched code (for 2nd person to work on branch)
python scripts/rr_git.py --action branch --tag-label vX.X.X --branch-label X.X.X --destination ~/tmp
(the same command as above)
Building - Bamboo
Bamboo should be configured to create "branch" plans automatically.
If you have updated one of the sub-modules you may need to manually trigger the build job as not all dependencies are set as triggers.
Testing Releases
Builds are available here:
\\rr-bamboo.northbristol.local\Registry_Utils
Releases
First off, liaise with Fran Benoy-Deeney about any releases to be made.
Builds from the Bamboo process are available here:
\\rr-bamboo.northbristol.local\<Product>\<Branch Label>\<ISODate.BambooBuildNumber>
When the code is ready to be released,
- Â Checkpoint the release branch with
rr_git.py --tagbranch --branch-label <branch-label> --tag-label <tag-label> - When the build from 1 is finished, the selected build is to be copied here:
r:\registry_utils\<Product>\<Branch> - Change the path in the r:\registry_utils\<product>\run.bat to point at the right place.