-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Expand file tree
/
Copy pathbuild-local.sh
More file actions
executable file
·64 lines (52 loc) · 2.2 KB
/
Copy pathbuild-local.sh
File metadata and controls
executable file
·64 lines (52 loc) · 2.2 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
## This is a helper script for non-containerized local build and test execution.
## It downloads and uses the daily SDK which contains the compatible AspNetCore bits.
## Usage:
## ./build-local.sh [StressConfiguration] [LibrariesConfiguration]
version=7.0
repo_root=$(git rev-parse --show-toplevel)
daily_dotnet_root=./.dotnet-daily
stress_configuration="Release"
if [ "$1" != "" ]
then
stress_configuration=${1,,} # Lowercase all characters in $1
stress_configuration=${stress_configuration^} # Uppercase first character
fi
libraries_configuration="Release"
if [ "$2" != "" ]
then
libraries_configuration=${2,,} # Lowercase all characters in $1
libraries_configuration=${libraries_configuration^} # Uppercase first character
fi
echo "StressConfiguration: $stress_configuration, LibrariesConfiguration: $libraries_configuration"
if [ ! -d $daily_dotnet_root ];
then
echo "Downloading daily SDK to $daily_dotnet_root"
mkdir $daily_dotnet_root
wget https://dot.net/v1/dotnet-install.sh -O $daily_dotnet_root/dotnet-install.sh
bash $daily_dotnet_root/dotnet-install.sh --no-path --channel $version.1xx --quality daily --install-dir $daily_dotnet_root
else
echo "Daily SDK found in $daily_dotnet_root"
fi
testhost_root=$repo_root/artifacts/bin/testhost/net$version-Linux-$libraries_configuration-x64
export DOTNET_ROOT=$daily_dotnet_root
export PATH=$DOTNET_ROOT:$PATH
export DOTNET_MULTILEVEL_LOOKUP=0
if [ ! -d "$testhost_root/shared/Microsoft.AspNetCore.App" ]
then
echo "Copying Microsoft.AspNetCore.App bits from daily SDK to testhost: $testhost_root"
cp -r $daily_dotnet_root/shared/Microsoft.AspNetCore.App $testhost_root/shared/Microsoft.AspNetCore.App
else
echo "Microsoft.AspNetCore.App found in testhost: $testhost_root"
fi
echo "Building solution."
dotnet build -c $stress_configuration
runscript=./run-stress-${stress_configuration,,}-${libraries_configuration,,}.sh
if [ ! -f $runscript ]
then
echo "Generating runscript."
echo "$testhost_root/dotnet exec ./bin/$stress_configuration/net$version/HttpStress.dll \$@" > $runscript
chmod +x $runscript
fi
echo "To run tests type:"
echo "$runscript [stress test args]"