Python project private repo requirement

In drone 0.4 we could install a private repo from our python requirements.txt using an ssh link like git+ssh://[email protected]/organivation/[email protected]#egg=gn4 however our build-server with 0.7 gets Host key verification failed. and we need to use https like git+https://github.com/organization/[email protected]#egg=gn4.

The problem here is that for our deployments we really need the ssh version so we can use our keys, so we don’t want to modify the requirements as such. What would be the best way to accomplish this and why does the new drone not work with ssh-keys?

(I’m thinking of using some sed command to modify the requirements just for the build)

1 Like

why does the new drone not work with ssh-keys?

Because ssh deployment keys only allow you to clone a single repository, compared to token-based https cloning which allow you to clone any private repository. The new approach has made it much easier to clone private dependencies.

What would be the best way to accomplish this

Yes, there are a few different options. I recommend you just execute the below command which instructs the git client to always use git+https without having to change your requirements.txt file.

git config --global url."https://github.com/".insteadOf [email protected]:

For example:

pipeline:
  build:
    image: ruby
    commands:
      - |
        git config --global url."https://github.com/".insteadOf [email protected]:
      - pip install -r requirements.txt

Sorry for the late reply. We temporarily solved it by a simple
sed -i 's/ssh:\\/\\/[email protected]/https:\\/\\//' requirements.txt

However telling the git-client what to use as you suggest seems useful as well. Can you explain the | and newline in your syntax?