Created
April 1, 2018 17:28
-
-
Save ckolumbus/64a055d26416c7790eb626e85511f36c to your computer and use it in GitHub Desktop.
cake-build bash bootstrap script using dotnet core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# based on https://github.com/devlead/BitbucketPipelinesShield/blob/master/build.sh | |
# c.f. https://github.com/cake-build/cake/issues/1751 | |
########################################################################## | |
# This is the Cake bootstrapper script for Linux and OS X. | |
# This file was downloaded from https://github.com/cake-build/resources | |
# Feel free to change this file to fit your needs. | |
########################################################################## | |
# CKolumbus: Remove dotnet-cli install section, assume sdk is installed | |
# Define directories. | |
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | |
TOOLS_DIR=$SCRIPT_DIR/tools | |
CAKE_VERSION=0.26.1 | |
CAKE_DLL=$TOOLS_DIR/Cake.CoreCLR.$CAKE_VERSION/Cake.dll | |
# Make sure the tools folder exist. | |
if [ ! -d "$TOOLS_DIR" ]; then | |
mkdir "$TOOLS_DIR" | |
fi | |
########################################################################### | |
# INSTALL CAKE | |
########################################################################### | |
if [ ! -f "$CAKE_DLL" ]; then | |
curl -Lsfo Cake.CoreCLR.zip "https://www.nuget.org/api/v2/package/Cake.CoreCLR/$CAKE_VERSION" && unzip -q Cake.CoreCLR.zip -d "$TOOLS_DIR/Cake.CoreCLR.$CAKE_VERSION" && rm -f Cake.CoreCLR.zip | |
if [ $? -ne 0 ]; then | |
echo "An error occured while installing Cake." | |
exit 1 | |
fi | |
fi | |
# Make sure that Cake has been installed. | |
if [ ! -f "$CAKE_DLL" ]; then | |
echo "Could not find Cake.exe at '$CAKE_DLL'." | |
exit 1 | |
fi | |
########################################################################### | |
# RUN BUILD SCRIPT | |
########################################################################### | |
# Start Cake | |
exec dotnet "$CAKE_DLL" "$@" | |
the Cake bootstrapper script for Linux and OS X. | |
# This file was downloaded from https://github.com/cake-build/resources | |
# Feel free to change this file to fit your needs. | |
########################################################################## | |
# Define directories. | |
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | |
TOOLS_DIR=$SCRIPT_DIR/tools | |
CAKE_VERSION=0.26.1 | |
CAKE_DLL=$TOOLS_DIR/Cake.CoreCLR.$CAKE_VERSION/Cake.dll | |
# Make sure the tools folder exist. | |
if [ ! -d "$TOOLS_DIR" ]; then | |
mkdir "$TOOLS_DIR" | |
fi | |
########################################################################### | |
# INSTALL CAKE | |
########################################################################### | |
if [ ! -f "$CAKE_DLL" ]; then | |
curl -Lsfo Cake.CoreCLR.zip "https://www.nuget.org/api/v2/package/Cake.CoreCLR/$CAKE_VERSION" && unzip -q Cake.CoreCLR.zip -d "$TOOLS_DIR/Cake.CoreCLR.$CAKE_VERSION" && rm -f Cake.CoreCLR.zip | |
if [ $? -ne 0 ]; then | |
echo "An error occured while installing Cake." | |
exit 1 | |
fi | |
fi | |
# Make sure that Cake has been installed. | |
if [ ! -f "$CAKE_DLL" ]; then | |
echo "Could not find Cake.exe at '$CAKE_DLL'." | |
exit 1 | |
fi | |
########################################################################### | |
# RUN BUILD SCRIPT | |
########################################################################### | |
# Start Cake | |
exec dotnet "$CAKE_DLL" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment