...
Introduction
The script rr_git.py is found in the housekeeping repository which also contains the scripts used in the Bamboo build jobs.
The purpose of the script is to support the development of the UKRR tools - Validation/Site Validation/Editor/RR Merge. Each Application is built from packages held in multiple repositories so the script handles the checking out, branching, committing etc. of these multiple repositories at once via single commands. It also retrieves metadata from the requirements.txt files about which repositories are required by each tool. Without further modification the script is not applicable to any other development tasks.
Unfortunately limited documentation was produced at the time the script was written and there appear to be some errors/omissions (although some of these may be due to trying to use the script in ways other than it was intended). The purpose of this page is to document what the code does in response to each of the commands. The pages that describe the Validation development/release process will document which commands should be used in which situation.
Destination Parameter
If --destination is supplied then it must be a valid path, otherwise the script will exit. If --destination is not supplied a folder will be created in the Temp directory.
NoClone Parameter
If NoClone is False (Default is False if not supplied) -
...
Code Block |
---|
git branch REPO_URL -b BRANCH |
Action Parameter
--action tag
Requires
- --tag_label v1.1.1
Function
Runs:
- git tag v1.1.1
- git push origin v1.1.1
--action branch
Requires
- --tag_label v1.1.1
- --branch_label 1.1.1
Function
Runs:
- git checkout v1.1.1 -b 1.1.1
- git push -u origin 1.1.1
--action delete_tag
Requires
- --tag_label v1.1.1
Function
Runs:
- git tag v1.1.1
- git push origin :refs/tags/v1.1.1
Note |
---|
GS: I'm not sure why this is trying to create the tag before it tries to delete it. See https://stackoverflow.com/questions/5480258/how-to-delete-a-remote-tag for more information. |
-- action report
Requires
- --start_tag v1.1.0
- --end_tag v1.1.1
Function
Runs:
- git log v1.1.0..v1.1.1
This appears to be to list all the comits that occured between two tags.
--action update
Requires
- --message "This is a message"
Note |
---|
I'm not sure if this is intended to work without the branch_label parameter however I suspect with the code as-is it will crash without it. |
Function
This is intended to re-write the requirements.txt in each of the cloned folders under the destination folder so that they're using the appropriate branch.
...
- git add .
- git commit -m "This is a message"
- git push
--action tagbranch
Requires
- --tag_label v.1.1.1
- --branch_label 1.1.1
Function
Runs:
- git tag v1.1.1 1.1.1
- git push origin v1.1.1
...