Build from git repo subroot folder

I have a git repo that is connected to Appflow and there are 2 folders at the root. One of them is the actual ionic app and the other is for the backend called /api. How would I create a build in Appflow from the app and not at the root?

–/
----/app <== I want the build to be here
----/api
----/ README.md

The build is obviously failing because it cannot find the actual project. I have the /api deployed to heroku and am starting to think I need 2 repositories? Please help, thank you.

Appflow technically doesn’t support this kind of setup at the moment. You’ll probably want to split the two projects into different repos.

Is that usually the case for ionic apps? Have one repo for the ionic app and another repo for the backend code? @mhartington

Yeah, this is pretty common in most projects, not just ionic apps

That’s disappointing. Since the pipeline runs in a container, it would be great to expose the “working directory” configuration to the end user so that we don’t have to restructure source code specifically for Appflow. As you are probably aware, there are so many other tools that come into the SDLC and if all of them had the right to impose their own paradigms, tools would mostly be mutually exclusive.

As an example, I have a monorepo with code that is shared between frontend and backend. If I split them into different repositories then I have a different problem to solve :frowning_face:

Disappointing indeed. I was just going to test out Appflow and immediately was blocked by this “feature”. We always have both api and apps in the same repository.

Hi all, just a heads up that monorepo support (which would enable this use case) is next on our roadmap for Appflow and I would expect this to go live in a month or so. Stay tuned!

4 Likes

Hello @max, any news on monorepo support? :slight_smile:

It’s coming but still a ways off. Appflow is predicated on the idea of a single hybrid mobile project in the root of the repo. In some cases we can use a bit of scripting to work around that. In other cases it’s best to prepare a commit with the necessary structure on a different branch, or in a different repo altogether. If you have an account with access to Android/iOS builds feel free to open a ticket by emailing support@ionic.io. If there’s a simple fix we can steer you in the right direction.

I successfully followed this example to setup monorepo support and it is working well

Including link to support for Monorepo in current documentation for changes to appflow.config.json to support.

https://ionic.io/docs/appflow/cookbook/appflow-config