User Tools

Site Tools


bloglike:2022-01

This is an old revision of the document!


Issue 2022 - January

AWS CodePipeline + GitHub + git submodule

There are couple of how tos AWS CodePipeline + GitHub and git submodule around - one, two(which discusses handful of solutions), three, four. And here is the one which works for me in given setup:

  1. private repositories hosted at GitHub
  2. AWS CodeStar connection to GitHub
  3. AWS CodePipeline with “full clone”
  4. AWS CodeBuild with the following buildspec
buildspec.yml
version: 0.2

env:
  git-credential-helper: yes

phases:
  build:
    commands:
      - git submodule update --init --recursive
      - ls -laR .

NOTES:

  1. URL in .gitmodules must be https://github.com/user-org/repo. Relative path and git+SSH didn't work for me. Actually, this was rather important finding for me and it looks like it's not mentioned anywhere. It looks like I will have to apply yet another hack since GitHub Actions require hack-around as well.
  2. Don't forget to allow AWS CodeBuild service role to use of AWS CodeStar connection, namely codestar-connections:UseConnection. Usually forgotten.
  3. What about SSH? What about it? Sadly, that's one way to deal with git submodules in GitHub Actions.
bloglike/2022-01.1642791665.txt.gz · Last modified: 2022/01/21 13:01 by stybla