I have been assigned to a project which uses git submodules. I did a small change in the markdown of the README.md and received the following error:
Running on staging.example.com...
Fetching changes...
HEAD is now at 2414dbe test change
From https://gitlab.example.com/external/project-example
2432dbe..b64b2d0 develop -> origin/develop
Checking out b452d91 as develop...
$ docker rm -f $CONTAINER_NAME-db
Error response from daemon: No such container: project-example-db
ERROR: Build failed: exit status 1
When I check the file named: .gitlab-ci.yml
I see this code:
# ADD
install:clean:
stage: prepare
script:
- docker rm -f $CONTAINER_NAME-db
- docker rm -f $CONTAINER_NAME
- docker rmi $IMAGE_NAME
allow_failure: true
tags:
- staging
# BUILD
prepare:build:
stage: prepare
script:
- git submodule init
- git submodule update --recursive
- docker-compose build --no-cache --pull
tags:
- staging
I'm not sure if my error is due to something missing with the submodules, my .gitmodules file looks like this:
[submodule "frontend"]
path = frontend
url = git@gitlab.example.com:external/project-example-frontend.git
branch = v3.1
I have the 2 repos (project-example & project-example-frontend) inside a directory. What am I missing?