How to auto deploying git repositories with submodules on AWS?

前端 未结 8 1075
长发绾君心
长发绾君心 2021-02-04 15:02

I have a submodule in my git repository and my directory structure is like,

app
  -- folder1
  -- folder2
  -- submodule @5855

I have deployed

8条回答
  •  半阙折子戏
    2021-02-04 15:17

    After banging my head against this all day, I've found a simple solution (for Code Pipeline) that doesn't require any SSH key juggling in the buildspec. I am using Bitbucket but I would think this would work for other providers. I'm also cloning my submodule via https, I'm not sure if that's a requirement or not.

    1. Configure your source to do a full clone of the repository. This will pass along the git metadata that you need.

    2. Configure your build role to add a customer-managed UseConnection permission to give your build action access to the credentials you configured for your source. Documentation from AWS here: https://docs.aws.amazon.com/codepipeline/latest/userguide/troubleshooting.html#codebuild-role-connections

    3. Set up your env to include git-credential-helper: yes and clone the submodule in your buildspec.yml:

    And that's it! Submodule will be available for build, and without having to do a bunch of key configuration for every submodule you want to use.

    Maybe a good addition to the documentation if this ends up being useful for people.

提交回复
热议问题