Cache NuGet packages on our CI server between builds.
Currently on our CI builds, we point our NuGet cache under the repo. In between builds the repo gets deleted, thus the cache is lost. This change moves the cache to %userprofile%\.nuget\packages on CI and dev boxes. On CI, we expire the cache after a day by default.
This commit is contained in:
parent
be4629a6a6
commit
617af759ae
5 changed files with 58 additions and 9 deletions
|
@ -4,7 +4,15 @@
|
|||
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
#
|
||||
|
||||
## Temporarily redirect to the NuGet package installation location
|
||||
export NUGET_PACKAGES=~/.nuget/packages
|
||||
export DOTNET_PACKAGES=$NUGET_PACKAGES
|
||||
export DNX_PACKAGES=$NUGET_PACKAGES
|
||||
export DNX_PACKAGES=$NUGET_PACKAGES
|
||||
|
||||
if [ ! -d $NUGET_PACKAGES ]; then
|
||||
mkdir -p $NUGET_PACKAGES
|
||||
fi
|
||||
|
||||
if [ -z "$NUGET_PACKAGES_CACHE_TIME_LIMIT" ]; then
|
||||
# default the package cache expiration to 1 week, in hours
|
||||
export NUGET_PACKAGES_CACHE_TIME_LIMIT=$(( 7 * 24 ))
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue