-
Notifications
You must be signed in to change notification settings - Fork 474
/
dogfood.sh
executable file
·48 lines (44 loc) · 1.67 KB
/
dogfood.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
if [ -z "$ZSH_VERSION" ]; then
source="${BASH_SOURCE[0]}"
# resolve $SOURCE until the file is no longer a symlink
while [[ -h $source ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
else
# :A will resolve all symlinks, :h will truncate last path component leaving you with a directory name
scriptroot=${0:A:h}
fi
REPO_ROOT=$(cd "${scriptroot}";pwd)
SDK_PATH=$REPO_ROOT/artifacts/bin/dotnet-tests
if [ ! -x "$SDK_PATH/dotnet" ]; then
echo "Error: Could not find dotnet at $SDK_PATH/dotnet"
return
fi
CONFIG=$1
if [ -n "$CONFIG" ]; then
PKG_DIR=$REPO_ROOT/artifacts/packages/$CONFIG/Shipping
if [ ! -d "$PKG_DIR" ]; then
echo "Error: Could not find packages path $PKG_DIR for CONFIG=$CONFIG"
return
fi
else
PKG_DIR=$REPO_ROOT/artifacts/packages/Release/Shipping
if [ ! -d "$PKG_DIR" ]; then
PKG_DIR=$REPO_ROOT/artifacts/packages/Debug/Shipping
fi
if [ ! -d "$PKG_DIR" ]; then
echo "Error: Could not find packages path in $REPO_ROOT/artifacts/packages for Release, or Debug configurations"
return
fi
fi
echo "Adding $SDK_PATH to \$PATH"
export PATH=$SDK_PATH:$PATH
echo Setting BUILT_NUGETS_PATH="$PKG_DIR" to resolve locally built packages
export BUILT_NUGETS_PATH=$PKG_DIR
echo
echo "Use $REPO_ROOT/tests/Aspire.Workload.Tests/data/nuget8.config as your local nuget.config to ensure the packages can be restored."