Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This is required by Pip when building requirements directly from Git. Note that there are standard Bamboo ways of doing "normal" checkouts which do not involve this.

Step-by-step guide

  1. Install Git for Windows onto the Bamboo server
  2. Restart the Bamboo service so that it picks up Git on the path
  3. Add a step to the build job to set the origin of the local git repo. Pip fails if this isn't done. This is required because Bamboo does something non-standard when it checks out code using a "Source Code Checkout" task.

    Code Block
    git remote remove origin
    git remote add origin ssh://jira.renalregistry.nhs.uk:7999/rr/rr_validation.git


  4. Copy the build key to:

    Code Block
    C:\Windows\SysWOW64\config\systemprofile\.ssh
    &
    C:\Windows\System32\config\systemprofile\.ssh

    These are the profile directories for the SYSTEM service account. I think one is used by 32-bit processes and one by 64-bit ones. This was a source of much frustration.

  5. Add a file named "config" to both those directories containing:

    Code Block
    Host jira.renalregistry.nhs.uk
        StrictHostKeyChecking no
        HostName jira.renalregistry.nhs.uk
        Port 7999
        IdentityFile ~/.ssh/id_rsa

    At one point i thought it was also necessary to create the known_hosts by running:

    Code Block
    ssh-keyscan -t rsa -p 7999 jira.renalregistry.nhs.uk > ~/.ssh/known_hosts

    but I think now that with StrictHostChecking disabled that probably isn't needed. I think the reason for the problem with known_hosts is that the port 22 and port 7999 SSH servers have different keys so if it connects to port 22 at some point by mistake it remembers the wrong key and complains when trying 7999.

  6. Set the lines in the requirements.txt to something similar to:

    Code Block
    -e git+ssh://git@jira.renalregistry.nhs.uk:7999/rr/rr_common#egg=rr_common


Filter by label (Content by label)
showLabelsfalse
max5
spacesINFRA
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("bamboo","git","ssh") and type = "page" and space = "INFRA"
labelsGit SSH Bamboo

Page Properties
hiddentrue


Related issues