L. T
L. T

Reputation: 11

ModuleNotFoundError: No module named 'Submodule1.Sobmodule2.Filename'

I am currently building a project with GitLab CI/CD and have come across the following Error message:

ModuleNotFoundError: No module named 'Submodule1.Submodule2.filename'

Submodule2 is a submodule inside Submodule1. In .gitmodules local paths were used (via ssh, see below). In .gitlab-ci.yml I have tried using:

variables:    
    GIT_SUBMODULE_STRATEGY: recursive

and (with various combinations):

before_script:
    - git submodule update --init --recursive
    - git config --global alias.clone = 'clone --init --recursive'
    - git submodule sync --recursive

Nothing seems to work. I would be thankful for each tip I can get. Here is my gitlab-ci.yml file:

image: docker:latest
 
services:
    - docker:dind
    - postgres:12.2-alpine

variables:
    #GIT_SUBMODULE_STRATEGY: recursive
    GIT_SUBMODULE_UPDATE_FLAGS: --jobs 4
    CI_DEBUG_TRACE: "true"
    POSTGRES_HOST_AUTH_METHOD: trust


stages:
    - build
 

build-run:
    stage: build
   
    before_script:
        - apk update && apk add git
        - git submodule update --init --recursive
    script:
        - echo Build docker image
        - docker build -t file -f Projectname .
        - docker build -t django -f django.Dockerfile .
        - echo Run docker compose
        - docker-compose -f docker-compose.unittest.yml up -d
        - sleep 60
        - docker logs unittests
 
    tags:
        - docker

My .gitmodules looks something like:

[submodule "Submodule1"]    
  path = Submodule1     
  url =../../...git
    
     
[submodule "Submodule1/Submodule2"]     
  path = Submodule1/Submodule2  
  url=../../...git

Upvotes: 1

Views: 120

Answers (0)

Related Questions