Updating submodules in a private repository

Good day!
We really need your help! I want to configure CircleCI for a private repository that has “submodule”. Submodules are connected via ssh.

The problem is similar to the topic:

Submodule ‘Module’ (git @github.com:***/Module.git) registered for path ‘Module’
Cloning into ‘/home/conan/project/Module’…
fatal: cannot run ssh: No such file or directory
fatal: unable to fork
fatal: clone of ‘git@github.com:***/Module.git’ into submodule path ‘/home/conan/project/Module’ failed
Failed to clone ‘Module’. Retry scheduled

Did on official instructions:

  1. Create a machine user - Complied with all the prescribed points;
  2. Moving on to Creating a GitHub User Key:
    2.1. For the user of the machine on the local machine, I generate ssh keys (public and private) by means of GitHub instructions;
    2.2. Then I insert the public key into the main repository (in the settings -> “Deploy key”);
    2.3. And insert the private key in the project settings (in CircleCI) in the item “SSH Permissions”. Hostname set as github dot com

But it didn’t. I attach an example of the beginning of the script:

version: 2.0
jobs:
linux-build:
docker:
- image: conanio/gcc6

steps:  
  - run: 
      name: Install Git
      command: |
        sudo apt-get update
        sudo apt-get install -qy git   
  - checkout
  - add_ssh_keys: # machine user
      fingerprints: "Fingerprint from SSH Permissions"
  - run:
      name: Install Submodules
      command: git submodule sync && git submodule update --init

Please tell me what I’m wrong. :slightly_smiling_face:

Observations:

  1. “User key GitHub” has never been used - taken from the “Deploy key” repository tab.
  2. Also, when the next session in the paragraph “Checkout code” always shows the following:

Either git or ssh (required by git to clone through SSH) is not installed in the image. Falling back to CircleCI’s native git client but the behavior may be different from official git. If this is an issue, please use an image that has official git and ssh installed.
Enumerating objects: 153, done.
Counting objects: 100% (153/153), done.
Compressing objects: 100% (86/86), done.
Total 153 (delta 72), reused 121 (delta 40), pack-reused 0

  1. In the script replaced: sudo apt-get install -qy git -> sudo apt-get install -qy git ca-certificates openssl

It was possible to solve this problem.

  1. You must use the official image:
    This resolves the issue with the message when checkout “Either it or she (required by getting to come through SSH) is not installed in the image”.
    I chose image:circleci/python: 3.7.0 since I need Conan. And also need gcc, but it is already the default, and the new version can be delivered via Conan.

  2. In the official instruction (point GitHub User Key) - “Add deploy key”. But in my case, it didn’t work. While I do not understand why? (It may be an error in the instructions :thinking:).
    I added ssh public key in machine user settings (Personal settings -> SSH keys) and it worked :sunglasses:.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.