How to change the build folder on aws CodeBuild

This is probably a simple question, but I did not find the answer.

I'm using AWS CodeBuild to build my code. However, in my repository (in this case it is on bitbucket), I kind of have 3 projects in the same repository.

These projects are in different folders. Two of them are angular projects.

So, I want to build just one project at a time in my Continuous Integration with CodeBuild.

If I try to use commands like "ng build", I receive an error because my main folder does not have an angular project. And that is right. Because my project is in a folder inside the main folder.

So, how can a change the "build path" of my build definition on AWS CodeBuild?

Thank you in advance.

1 answer

  • answered 2018-11-19 22:54 bwest

    Create a buildspec file for each of the builds you want to run. In the pre-build phase of the buildspec file, change to the appropriate directory. When you invoke the build, point to the necessary buildspec by using buildspecOverride.

    In the long term it might be easier to separate your three projects into their own repositories.