I indeed managed to use 'go mod vendor', which leads to much faster builds 
anyway. But it would be nice if the module tooling compared the vendor 
directory to match the checksums in go.sum, otherwise you can update on of 
your dependencies but forget about updating the vendored copy. Do you know 
whether it does this?

Thanks, Jorrit

On Monday, March 4, 2019 at 6:50:51 PM UTC+1, Marcin Romaszewicz wrote:
>
> Can you accomplish what you want with module vendoring? Before I set up my 
> own Athens proxy, I was using that to avoid DDOSing github in my build 
> automation, and it seemed to work fine. Your first pipeline step could 
> vendor in all the modules, and subsequent pipeline steps would use those.
>
> -- Marcin
>
>
> On Mon, Mar 4, 2019 at 8:49 AM <jsal...@travix.com <javascript:>> wrote:
>
>> I'd like to be able to use go mod download to download packages to 
>> another directory than GOPATH/pkg/mod and automatically have all go 
>> commands be aware of this new location.
>>
>>
>> This is specifically for CI/CD to ensure I can download modules in one 
>> stage and use them in subsequent stages.
>>
>>
>> I'm the author of https://estafette.io/, and just like Bitbucket 
>> Pipelines and Drone.io it executes steps in (public) docker containers, but 
>> the only data passed from stage to stage are the files inside the working 
>> directory. So downloading modules to a directory outside of the 
>> working directory makes them get downloaded again in subsequent stages.
>>
>>
>> NPM tackles this by having the node_modules directory as a local 
>> subdirectory of your repository, but of course this loses you the 
>> performance advantage of having a shared cache for all your repositories.
>>
>>
>> Nuget uses a global cache as well, but they allow you to specify an 
>> alternative location that gets used by their other commands by running 
>> dotnet 
>> restore --packages .nuget/packages.
>>
>>
>> A similar approach as dotnet takes would be best for all go module 
>> related commands to be able to prevent CI/CD from downloading the same 
>> modules multiple times. This could look something like go mod download 
>> -dir module_cache.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to