#how does the cache between steps work?

1 messages · Page 1 of 1 (latest)

wise zephyr
#

I have a dotnet repo, and my goal, is to both introduce in my dotnet team and make it an example for dagger.io, but I'm still struggling there and there.

In dotnet we have sln, csprojs and cs. solution is a list of csprojs, csprojs is a list of cs, and cs is the code, pretty straightforward.

In order to cache the external dependencies, is a good pattern to only copy sln and csprojs and do a restore, in this way when I modify any of the cs code, the restore part is "untouched" and is still cached.

this is my main.go

https://github.com/lucax88x/dotnet-template/blob/main/main.go#L135

As you can see, I'm iterating in my host to find sln, and csprojs, and then I do a WithMountedFile, then I kick a dotnet restore.

Sadly, everytime I run this in my local machine, it's never cached (even if I change no code), so I wonder, how does it work? does it check the sha of the files upon that layer, or what?

I struggle to understand what I'm doing wrong.

GitHub

Contribute to lucax88x/dotnet-template development by creating an account on GitHub.

wise zephyr
#

Ok, my mistake was because I was mounting directory instead of copying... not it caches! wonderful.