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

Design a system to allow a user to customize app build lifecycle. #1810

Open
ellismg opened this issue Mar 28, 2023 · 2 comments
Open

Design a system to allow a user to customize app build lifecycle. #1810

ellismg opened this issue Mar 28, 2023 · 2 comments

Comments

@ellismg
Copy link
Member

ellismg commented Mar 28, 2023

Today when we have to build a service (e.g. during the soon to be added package) we use the language of the service to inform what command we run.

For example, for a dotnet service, we run dotnet publish -c Release --output <an-intermediate-path-that-azd-creates> to build a release version of their application into a temporary folder.

We make similar decisions for the user in other app specific gestures like restore.

For all these cases, we should allow the user to override this behavior on a per service basis.

One possible approach is adding something to azure.yaml for a service like this:

services:
  api:
    language: dotnet
    host: appservice
    package: dotnet build -c Release /p:SomePropertyThatIsVeryImportantToMeForMyApp=true --output ${AZD_PUBLISH_ROOT}

In the above, a user can provide whatever command they want (and we provide a way to flow some AZD specific information, like where the output of the build should go, via substitutions like ${AZD_PUBLISH_ROOT}).

This would give the user full control over what is happening for cases where our defaults are wrong for their scenario.

When we do this, we should think about how this relates to a "none" language (or the concept of using azd to manage a service where azd does not have intrinsic knowledge of the toolchain (e.g. golang, today)

@ellismg ellismg added this to the Gallium milestone Mar 28, 2023
@savannahostrowski savannahostrowski self-assigned this Mar 28, 2023
@weikanglim
Copy link
Contributor

I love it.

Some small notes I've had, just to keep track of:

  1. Consider when user sets language to a value like other, package (and other buildtool commands) will be made a required property in azure.yaml.
  2. I wonder if users care about their output directory. I could see a different model where azd follows what the user provides instead, like:
services:
  api:
    language: dotnet
    host: appservice
    package: dotnet publish

By default, azd understands for dotnet, the default packaging folder used. If the user wanted to something differently:

services:
  api:
    language: dotnet
    host: appservice
    package: dotnet publish --output ./.myoutput
    dist: ./.myoutput

@savannahostrowski
Copy link
Contributor

@ellismg I think this falls into the general extensibility bucket. Happy to keep this open but related this item to #810!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants