Can not get submodules to clone properly

git

#1

I’m attempting to build a .NET Core project that has a dependency in the form of a git submodule. Locally, this works just fine and using git submodule update --remote I can pull the latest version of my dependencies properly.

However, on CircleCI I don’t see the submodules being mentioned anywhere in the output at all. My current configuration looks like this:

version: 2
checkout:
post:
    - git submodule init 
    - git submodule update --remote
jobs:
build:
    docker:
    - image: microsoft/dotnet:2.0.6-sdk-2.1.104-jessie
    steps:
    - checkout
    - run:
        name: build
        command: dotnet build src/Solution.sln

I’m using a similar configuration for other .NET Core projects, and they work fine. It’s specifically the submodules that appear to cause it to fail.

My checkout stage output currently looks like this:

Cloning into '.'...
Warning: Permanently added the RSA host key for IP address 'x.x.x.x' to the list of known hosts.

remote: Counting objects: 1708, done.        
remote: Compressing objects: 100% (1475/1475), done.        
remote: Total 1708 (delta 219), reused 1677 (delta 188), pack-reused 0        
Receiving objects: 100% (1708/1708), 15.05 MiB | 22.73 MiB/s, done.
Resolving deltas: 100% (219/219), done.
Checking connectivity... done.
Warning: Permanently added the RSA host key for IP address 'x.x.x.x' to the list of known hosts.

HEAD is now at aa4667a
HEAD is now at aa4667a

Which appears to flat out ignore the submodule init and submodule update --remote commands from my configuration.

Does anyone have any idea what I’m doing wrong here? I’d appreciate any help.

Thanks.


#2

The above is not CircleCI 2.0 syntax. You’re mixing 1.0 and 2.0. Perhaps try this instead:

version: 2
jobs:
  build:
    docker:
      - image: microsoft/dotnet:2.0.6-sdk-2.1.104-jessie
    steps:
      - checkout
      - run:
          name: "Pull Submodules"
          command: |
            git submodule init
            git submodule update --remote
      - run:
        name: "Build"
        command: dotnet build src/Solution.sln

#3

That works just fine, thanks for the help! Now I’m just curious how I managed to mix the v1 and v2 configuration, I’ve never even used any v1 stuff.

Cheers!


#4

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