Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running bicep build should compile everything in the directory #246

Open
ouldsid opened this issue Aug 17, 2020 · 4 comments
Open

Running bicep build should compile everything in the directory #246

ouldsid opened this issue Aug 17, 2020 · 4 comments
Labels
cli Affects command line experience devdiv Related to Bicep tooling efforts in DevDiv enhancement New feature or request Needs: Upvote This issue requires more votes to be considered

Comments

@ouldsid
Copy link
Member

ouldsid commented Aug 17, 2020

It is nice to be able run bicep build from within a folder and if no file (s) provided as an argument the tools iterate through the folder and compiles all bicep files within that folder (I'm not sure we have a file that is equivalent to csproj for example in C#)

@alex-frankel alex-frankel changed the title (Improvment) Running bicep build from within a folder Running bicep build should compile everything in the directory Aug 25, 2020
@alex-frankel alex-frankel added the enhancement New feature or request label Aug 25, 2020
@kuhlman-labs
Copy link

If we want to be able to create reusable modules this functionality is vital. This also will help with keeping bicep files more readable and manageable, some deployments are going to be quite large. A common pattern I have seen with customers using Terraform is that they will name the Terraform files for the functionality/resources it is deploying (ex. frontend.tf, backend.tf) and running their deployments from the root of the folder structure.

@stan-sz
Copy link
Contributor

stan-sz commented May 12, 2021

This answer #1285 (comment) seems relevant.

@ucheNkadiCode
Copy link
Contributor

ucheNkadiCode commented Mar 24, 2022

This has 8 or so upvotes across two different issues. Bicep build is also the highest used bicep cli commands after "bicep upgrad". While there are great options mentioned, users would have to ultimately search and find these issues each time to know the powershell commands. At first I was a big fan of changing the behavior of az bicep build to default to building all of the files in a particular directory, but I think the --all flag is a good addition.

The reason for the --all flag is, what if a user mistakenly writes az bicep build in their ~/User/Documents folder when they meant to also write --file blah.bicep? Or if they meant to write az bicep build --help? I wouldn't want to recursively start going through this many folders on an accident. The --all flag makes it more explicit in this case.

We could possibly put some safeguards to make sure this sort of mistake doesn't happen. I'm open to suggestions.

As @StefanIvemo mentioned in #1285, it would be a great idea to have:

bicep build --all - Compiles all .bicep files in the working directory.
bicep build --all --path /bicep/modules - Compiles all .bicep files in the /bicep/modules folder.

I propose this is retriaged.

@ucheNkadiCode ucheNkadiCode added the cli Affects command line experience label Mar 24, 2022
@ucheNkadiCode ucheNkadiCode added this to the Committed Backlog milestone Mar 24, 2022
@ucheNkadiCode ucheNkadiCode added the devdiv Related to Bicep tooling efforts in DevDiv label Mar 24, 2022
@ucheNkadiCode ucheNkadiCode added the Needs: Upvote This issue requires more votes to be considered label Apr 1, 2022
@anthony-c-martin
Copy link
Member

See #1285 for commands you can use to accomplish this today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Affects command line experience devdiv Related to Bicep tooling efforts in DevDiv enhancement New feature or request Needs: Upvote This issue requires more votes to be considered
Projects
None yet
Development

No branches or pull requests

6 participants