-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.sh
executable file
·42 lines (32 loc) · 1.34 KB
/
build.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
#!/bin/bash
# Define varibles
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
DOTNET_VERSION="8.0.100"
###########################################################################
# INSTALL .NET CORE CLI
###########################################################################
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
export DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX=2
DOTNET_INSTALLED_VERSION=$(dotnet --version 2>&1)
if [ "$DOTNET_VERSION" != "$DOTNET_INSTALLED_VERSION" ]; then
echo "Installing .NET CLI..."
if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
mkdir "$SCRIPT_DIR/.dotnet"
fi
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_VERSION --install-dir .dotnet --no-path
export PATH="$SCRIPT_DIR/.dotnet":$PATH
export DOTNET_ROOT="$SCRIPT_DIR/.dotnet"
fi
###########################################################################
# RUN BUILD SCRIPT
###########################################################################
SCRIPT_NAME="recipe.cake"
echo "Restoring .NET Core tools"
dotnet tool restore
echo "Bootstrapping Cake"
dotnet cake $SCRIPT_NAME --bootstrap
echo "Running Build"
dotnet cake $SCRIPT_NAME "$@"