...
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.
Note |
---|
Before doing this you MUST have done the steps at the end of the Release page to merge and tag the previous branch otherwise the following commands will fail. |
The first command clones all the repositories - including those from the requirements.txt. The second creates a new branch based on a particular tag.
Code Block |
---|
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 |
Note | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
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 requires
|
Warning |
---|
The above commands seem to be creating the branch but not switching to it. This needs investigating but in the meantime check manually that the version branch is the current one and change if not. |
Modifying requirements.txt
...
Where Y.Y.Y is the new version number and the name of our branch.
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.
You will need to commit each repo after the file has been updated.
...
This can be done with the command.
Code Block |
---|
rr_git.py --action update --branch Y.Y.Y --destination C:/Mywork/UKRR/Y.Y.Y --message "Update requirements.txt" Should do this automatically however it currently doesn't |
Note | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
At the moment the above command willl only work if there is 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 URL (leading to duplication). This needs the URls if the Deployment instructions have been followed correctly so you should be able to use the command.
|
Updating Version Numbers
...
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)
...
Code Block |
---|
rr_git.py --branch-label Y.Y.Y --destination C:/MyWork/UKRR/Y.Y.Y |
Issues
If you get the following...
Code Block |
---|
In rr_validation
Running git checkout v1.1.13 -b 1.1.14
Switched to a new branch '1.1.14'
Running git push -u origin 1.1.14
To ssh://bitbucket.renalregistry.nhs.uk:7999/rr/rr_validation.git
! [rejected] 1.1.14 -> 1.1.14 (non-fast-forward)
error: failed to push some refs to 'ssh://git@bitbucket.renalregistry.nhs.uk:799
9/rr/rr_validation.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details. |
And then you get...
Code Block |
---|
C:\Temp\UKRR\1.1.14\rr_validation>git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> 1.1.14 |
The solution seems to be -
Code Block |
---|
C:\Temp\UKRR\1.1.14\rr_validation>git branch --set-upstream-to=origin/1.1.14 1.1.14
Branch '1.1.14' set up to track remote branch '1.1.14' from 'origin'. |