Copilot-cli: Feature request: support copilot dir in subtree in repo

Created on 24 Sep 2020  ·  1Comment  ·  Source: aws/copilot-cli

I’m working on bootstrapping a monorepo (my first time, fwiw) to host a legacy system that I’m porting into this monorepo.

  • This system (app) has multiple subsystems (services); I’m putting them in /apps/
  • I anticipate needing to work with multiple infrastructure tools in this monorepo.
  • I’d like to locate all Copilot-related resources (manifests, add-ons, .workspace) in /infrastructure/copilot/

This worked until I upgraded to v0.4.0 a day or two ago; I could be in /infrastructure/ and run copilot svc deploy --name my-app --dockerfile ../apps/my-app/Dockerfile and the command succeeded.

After upgrading to v0.4.0, I’m getting this:

Note: It's best to run this command in the root of your workspace.
✘ Dockerfile /Users/avi/dev/my-repo/apps/my-app/Dockerfile not within workspace /Users/avi/dev/my-repo/infrastructure

I understand that the way I was using Copilot wasn’t the officially recommended way of using it, but it was working for me and I liked it.

I suspect other folks might have similar needs.


FWIW, I’ve traced this change to 6a8fa3d1f69dc417a04c1eb68b1f6d377bbc769b.


A few suggestions for the UX:

  1. My preference would be something like adding a --workspace option to most CLI commands, so I could just specify the path to my workspace.

    1. (I suspect I may be misusing the term “workspace” here — it seems that within Copilot, a “workspace” is supposed to contain the dir copilot in its root, and the services are supposed to be in the same root. In other words, the services are supposed to be co-located with the dir copilot and it’s the combination of the two that’s a Copilot “workspace”. My preference, however, would be for that concept to evolve a bit, or perhaps we come up with a new term/concept for the dir copilot and its contents.)

  2. If I really need to move copilot out into the root of my monorepo, I’d prefer to name it .copilot (with the leading period character in its name)

Of course I understand completely if these suggestions are declined. No worries either way.


Thank you!

typbug

Most helpful comment

🎉 thanks @huanjani !

>All comments

🎉 thanks @huanjani !

Was this page helpful?
0 / 5 - 0 ratings