Replies: 6 comments 3 replies
-
The artifacts from an Aspire repo build should simply be:
Those two things should give you everything you need to deploy the resources built by your Aspire solution using your deployment toolchain of choice. When using .NET Aspire, the service projects themselves are no different from any other ASP.NET Core project, so they produce the same kind of assets. The key difference is that when using Aspire Components, your projects expect configuration values in specific keys. When composed by the AppHost project, that will all be represented in the Aspire manifest. |
Beta Was this translation helpful? Give feedback.
-
Thank you @DamianEdwards for your reply. I’m not really concerned about the deployment part for the time being, I’m mostly looking for a continuous integration pipeline example whose output will be deployable artifacts. |
Beta Was this translation helpful? Give feedback.
-
That depends on how you're going to deploy, but at a minimum, you can simply run /Cc @baronfel |
Beta Was this translation helpful? Give feedback.
-
@DamianEdwards is right - you can specify the target at the solution-level and MSBuild will call that target on the projects in the solution. There are a couple hurdles at the moment that may bite you if you have projects other that web or worker projects in the solution, because today the "PublishContainer" target doesn't exist (even if not callable) for all project types. We're working on that for the next SDK release early in 2024. If that's a big problem you have a few options:
I've got a number of different publishes to different container registries in a GitHub Actions workflow here that you can take a look at for an example - they are very similarly structured. The overall approach is a) login to the destination, b) push the container via the SDK. There's just varying amounts of juggling along the way of getting the token to login with. One thing to note is that if you're using GitFlow you probably have a sense of what version you want the app to be. You can pass the |
Beta Was this translation helpful? Give feedback.
-
I forgot to mention that indeed I want to produce container images, that was crucial info that was missing - sorry about that @DamianEdwards . @baronfel can’t speak for everyone of course but our teams would be just fine with just web and worker project types, so that is not an issue at the moment. The actionable feedback first: do you happen to have a public monorepo with a complex pipeline that includes both static code analysis and security tools and release management? One that “builds once” is a big plus. Now, I hope you don’t mind if I bounce some ideas off you, but, as they say, I’d like to learn from the pros. My typical CI pipeline would look as follows, off the top of my head:
I’m building once and reusing the build output throughout the pipeline. I did gloss over the release management part - creating a |
Beta Was this translation helpful? Give feedback.
-
I see the issue has been converted to a discussion by @danmoseley. Aspire seems to drive users towards monorepos, yet there is no guidance whatsoever at the moment regarding CI automation besides basic examples. Unless Aspire is meant to be used only with CI/CD pipelines that deploy straight to prod, this is an issue in my eyes. |
Beta Was this translation helpful? Give feedback.
-
Hello,
Fantastic project. Very excited about Aspire.
Just to add some context: I believe that small-sized monorepos (3 to 5 artifacts tops, an arbitrarily low number) are very useful and enable a super-fast inner loop.
Now, I'm happy to see that Aspire has more than one deployable project in one solution, I think it's the perfect spot.
I'm just curious what would the recommended CI story be - let's say we use a good old GitFlow branching strategy.
Will there be any guidance provided in order to show how to correctly produce artifacts from an Aspire repo?
Beta Was this translation helpful? Give feedback.
All reactions