Closed augustoproiete closed 3 years ago
@augustoproiete thanks for kicking off the discussion on this!
Everything here makes sense to me, with one exception...
Install .NET 5 or .NET Core
As a local dev, I work on a number of different projects, and as such, I may require different version of .NET installed. To facilitate this, as an example in the Cake repository itself, the bootstrapper installs the required version of .NET by pinning to the version that is defined in the global.json file. By doing this, I know that the build will always work locally, without having to do anything else.
Ideally, the bootstrapper would check to see if the required version of .Net is installed, and if not, take appropriate actions.
I understand that not everyone is sold on this idea though, so I would be happy to start with what you have suggested here. Did you want to send in a PR to add what you have, and we can go from there?
As a local dev, I work on a number of different projects, and as such, I may require different version of .NET installed. To facilitate this
That makes sense to me and I have a similar situation in some of my projects as well. In this scenario my (personal) preference is to have a separate setup.ps1
/ setup.sh
that performs these kind of one-time setup to get the local dev environment ready and leave the build bootstrappers to do the minimum necessary to run Cake - but that's me.
I'll send a PR with the example scripts above just to get something going.
One other idea would be to put together a little "bootstrapper builder" UI where users can cherry-pick things they want and download a more customized boostrapper based on their preferences. Something along those lines:
One other idea would be to put together a little "bootstrap builder" UI where users can cherry-pick things they want and download a more customized boostrapper based on their preferences. Something along those lines:
@augustoproiete This is something I like 😄 Can you create an issue for this in the https://github.com/cake-build/website repo to discuss further there?
@pascalberger https://github.com/cake-build/website/issues/1297
@augustoproiete I like the idea of the Bootstrapper Builder 👍
We would still need to have a final version, which can be downloaded via the known URL's in things like the VSCode extension, but I love the idea of being able to cherry pick something for your own needs.
We would still need to have a final version, which can be downloaded via the known URL's in things like the VSCode extension, but I love the idea of being able to cherry pick something for your own needs.
Not if we provide an API to it: https://github.com/cake-build/website/issues/1297#issuecomment-737960188 😄
@pascalberger what I meant was, in the version of the VSCode extension that we have literally just shipped, there is an expectation that you can download one of 6 bootstrappers. I think we need to provide those bootstrappers, and then, going forward, we can look to provide something else.
Yes, but we can provide a REST API to download them, which allows to pass parameters what should be in the bootstrapper instead of just a full final version. Existing URLs can redirect to the API using some default values. But this is a discussion for https://github.com/cake-build/website/issues/1297 (or maybe even an issue on top of https://github.com/cake-build/website/issues/1297).
I'm absolutely OK to have a bootstrapper in here. My comment was more that, if once we have an API we no longer need bootstrappers stored in a repo.
@pascalberger said.. I'm absolutely OK to have a bootstrapper in here. My comment was more that, if once we have an API we no longer need bootstrappers stored in a repo.
Understood. Fairly sure that we are on the same page 😄
I'm interested in helping on the bootstrapper templates/example for Cake using the dotnet tool, so opening this issue to discuss how they should look like.
:white_check_mark: Things that come to mind of what the example bootstrapper should do (probably in this order):
Ensure the bootstrapper stops in case of errors and forwards the exit code of the process that failed
Change the working directory to the folder where the bootstrapper is located
This is to make sure commands inside the bootstrapper are run in the expected directory relative to the bootstrapper. e.g.
Disable the default caching of NuGet packages (a.k.a. "First Time Experience")
This makes sense when running on temporary build nodes that are provisioned for each build (as the cache will be destroyed, so no point in having it enabled). For permanent build nodes on a self-hosted environment it might make sense to leave this enabled. I'd suggest a short comment with a link to a URL on the Cake website that explains more details and when it makes sense to disable or not
Disable the .NET SDK telemetry feature
Disable the .NET SDK welcome message
Restore dotnet local tools (in case Cake is installed as a local tool)
dotnet tool restore
returns exit code0
if a manifest is not found, so it's a safe call. If no manifest is found, the user just sees a warning messageRun the dotnet-cake tool forwarding any arguments passed to the bootstrapper
:x: Things that come to mind of what the example bootstrapper shoud not do:
Install .NET 5 or .NET Core
Why not:
Install the Cake dotnet tool
Why not:
Examples of the above (without comments, to simplify):
build.ps1
build.sh