Configuration problems for CI builds with Git private submodule

I’m attempting a build on a repository with a private submodule, but I’m unable to get the runner to clone the repository.

Submodule 'source' (git@gitlab.com:rivy/blog.content.git) registered for path 'source'
Cloning into '/builds/rivy-t/blog._hexo_/source'...
error: cannot run ssh: No such file or directory
fatal: unable to fork
fatal: clone of 'git@gitlab.com:rivy/blog.content.git' into submodule path '/builds/rivy-t/blog._hexo_/source' failed

The other submodules seem to be cloning without issue.

I read the docs and tried various suggested methods even though the suggestion from the most recent docs is that since I own both repositories, it should “just work”. The repositories are under different organizations, so I added the original/builder repository organization (“rivy-t”) as a “developer” (and then “maintainer”) on the private submodule repository. But it’s still failing with the same error messages.

# .gitmodules
[submodule "source"]
    path = source
    url = git@gitlab.com:rivy/blog.content.git
[submodule "themes/landscape"]
    path = themes/landscape
    url = https://github.com/hexojs/hexo-theme-landscape
[submodule "themes/next"]
    path = themes/next
    url = https://github.com/theme-next/hexo-theme-next
[submodule "themes/octo"]
    path = themes/octo
    url = https://github.com/rivy/hexo-theme.octo.git

It does pull correctly for local machines.

# This file is a template, and might need editing before it works on your project.
# Full project: https://gitlab.com/pages/hexo
image: node:12

variables:
  # ref: <https://docs.gitlab.com/ee/ci/git_submodules.html#using-git-submodules-in-your-ci-jobs>
  GIT_SUBMODULE_STRATEGY: recursive

# # gitlab to firebase
# # * see <https://medium.com/evenbit/automatically-deploy-to-firebase-with-gitlab-ci-546f194c44d8> @@ <https://archive.is/kFgZz>
# # * see <https://medium.com/@rambabusaravanan/firebase-hosting-deployment-automation-with-gitlab-ci-f3fad9130d62> @@ <http://archive.is/P670x>
# firebase:
#   stage: deploy
#   cache:
#     key: "$CI_PROJECT_NAME;firebase"
#     paths:
#       - node_modules
#   script:
#     - npm install
#     - ./node_modules/hexo/bin/hexo config criticalcss.enable false
#     # firebase
#     - ./node_modules/hexo/bin/hexo clean
#     - ./node_modules/hexo/bin/hexo config root "/"
#     - ./node_modules/hexo/bin/hexo generate
#     - ./node_modules/hexo/bin/hexo gzip
#     - ./node_modules/firebase-tools/lib/bin/firebase.js use t-hexo --token $FIREBASE_TOKEN
#     - ./node_modules/firebase-tools/lib/bin/firebase.js deploy -m "$CI_PROJECT_PATH; pipeline $CI_PIPELINE_ID ($CI_PIPELINE_URL)" --non-interactive --token "$FIREBASE_TOKEN"
#   artifacts:
#     paths:
#       - public
#   only:
#     - master

pages:
  stage: deploy
  cache:
    key: "$CI_PROJECT_NAME;pages"
    paths:
      - node_modules
  before_script:
    - git submodule sync --recursive
    - git submodule update --init --recursive
  script:
    - npm install
    - ./node_modules/hexo/bin/hexo config criticalcss.enable false
    # GitLab Pages
    # * enable draft publishing (should only be enabled if GitLab Pages private-access-only is also enabled)
    - ./node_modules/hexo/bin/hexo config render_drafts true
    - ./node_modules/hexo/bin/hexo clean
    - ./node_modules/hexo/bin/hexo config root "/${CI_PROJECT_NAME}/"
    - ./node_modules/hexo/bin/hexo generate
    - ./node_modules/hexo/bin/hexo gzip
  artifacts:
    paths:
      - public
  only:
    - master
    - x

I used this config successfully when the repository was a single unit previously. (The “firebase” deployment is planned to be tested and re-enabled once I can get the deployment to “pages” working correctly again.)

I’m not sure how to proceed. Advice on configuration changes?

Thanks for taking the time to look at this.

  • Roy Ivy