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

Allow skipping API build #343

Closed
anthonychu opened this issue Apr 1, 2021 · 9 comments
Closed

Allow skipping API build #343

anthonychu opened this issue Apr 1, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@anthonychu
Copy link
Member

Add support for skipping API build (like how we added skip_app_build) and allow customer to specify the language for the function app (use an allow list, will eventually need to include language version too).

@paule96
Copy link

paule96 commented Jan 8, 2022

I'm not sure if I should open a new issue for this or write a comment here. So I start with writing a comment here.
Because of this issue, I did reverse engineered the calls that the docker container does in the pipeline. You can find my script here.
It's definitely not complete but show what I think most of the enterprise customers want before to work with this kind of technology. A splitting between build and deployment. This script basically just accepts two file paths to the publish output of the app, and just upload it. (see the readme)
This script works for me, but it has its issues, here a brief list:

  • there is no force upload. if you want a force upload change a file
  • it does not support right now branch environments (maybe I have time to implement it)
  • it's without warranty 🤷‍♀️

I use this regularly and will maybe replace the current GitHub action / workflow with-it.
Maybe that is just an old and not wanted mindset anymore, but I still have many projects that require the splitting of build and deployment in two different tasks. (Because they are time in depended on and there is usually more than one stage.
So, I hope we can make this possible to do this.

A nice side effect of this is: my deployment times even from my local laptop with bad internet speeds are relatively fast. (Just 2mins or so) With the before used docker container I need around half an hour because he must always download dotnet 6 and all my NuGet packages i use.

So hope this helps a bit more to make this service to be even better. After all I think the service is a really good service and I will try I definitely more often in the feature.

@svrooij
Copy link

svrooij commented Feb 7, 2022

This is related to #493 and and microsoft/Oryx#1172

We want to deploy this static web app, where the api part has a dependency to a private nuget repository. At the moment there is no way (or not documented) on how get it deployed with that package in the source. I wish not to add the package to nuget.org since it's a private package in a private nuget feed.

We are perfectly able to build the app our self in Azure DevOps, but it won't deploy.

We would also be helped with an option to restore the packages before the AzureStaticWebApp task and adding the build parameter --no-restore. Not sure if that would work though.

@anthonychu
Copy link
Member Author

@Reshmi-Sriram might be able to provide an update on this feature and when it might land in GitHub Actions and Azure Pipelines task.

@Reshmi-Sriram
Copy link

Hi All,
The code fix for skip_api_build flag is complete and we expect it to roll out as a part of GitHub Actions and Azure Pipelines tasks by another 3 weeks! 🎉
CC// @pvbchak

@Reshmi-Sriram
Copy link

Hi All, The code fix for skip_api_build flag is complete and we expect it to roll out as a part of GitHub Actions and Azure Pipelines tasks by another 3 weeks! 🎉 CC// @pvbchak

UPDATE: skip_api_build should now be enabled in GitHub Actions!🎉🎉
In order to use it, we need to set skip_api_build: true in the GitHub workflow yaml and specify the ApiRuntime version in the staticwebapp.config.json file in source repository.

Azure DevOps changes are being merged meanwhile and can be tracked in the following PR

@svrooij
Copy link

svrooij commented Mar 28, 2022

This microsoft/azure-pipelines-tasks#15996 seems to be have merged. That means this issue can be closed as well?

@collinbarrett
Copy link

collinbarrett commented Apr 21, 2022

When using skip_api_build, how do we specify the path to the pre-built api artifacts so that Azure/static-web-apps-deploy knows where to get the function code artifacts from?

The docs for api_location (my best guess for the parameter I'm looking for) specify:
> Directory location of the Azure Functions source code

(note, "source code", not pre-built artifacts)

Should there be a parameter such as api_output_location, api_artifacts_location, or similar? I tried tracing down how the StaticSitesClient works, but it appears it's not open source yet.

Oh, it looks like api_location is correct, I just had incorrectly prebuilt my artifacts so I couldn't distinguish between failed deploy and failed build. I wonder if the docs for output_location and api_location should be updated to specify "source code" or "artifacts".

@anthonychu
Copy link
Member Author

@collinbarrett Thanks for the suggestion. I've submitted changes to the docs that should be live soon.

@thomasgauvin
Copy link
Contributor

The doc changes have been merged, closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants