CDK codebuild project - put code in a subdirectory?

Viewed 46

I have the following aws-codebuild Project which gets some source from a Github repo, then does some build actions.

  const project = new Project(scope, "RaidoDbS3Import", {
    vpc: props.vpc,
    subnetSelection: { subnetType: SubnetType.PRIVATE_WITH_NAT },
    securityGroups: props.securityGroups,
    source: Source.gitHub({owner: "au-research", repo: "raido-v2"}),
...

I would like to change this to get the source code into a sub-directory, so that I can put some data files in a sibling directory to the codebase.

I've looked around in the props for Project and GitHubSourceProps, but don't see anything that seems relevant.

My workaround will be to put the data files into an ignored subdirectory of the repository; but this questions is about "How can I clone the Github repository into a subdirectory of the codebuild current directory?"

1 Answers

Another workaround can be using git submodules for your data and fetch it while cloning repo.

Related