Skip to content

Commit

Permalink
publishing as self contained project
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathiyarasy committed Nov 14, 2024
1 parent 2951f04 commit 7ba8681
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/oryx/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,21 @@ PATCH_VERSION_ID=$(echo $(dotnet --version) | cut -d . -f 3)

PINNED_SDK_VERSION=""
# Oryx needs to be built with .NET 8
if [[ "${DOTNET_BINARY}" = "" ]] || [[ $MAJOR_VERSION_ID != "8" ]] || [[ $MAJOR_VERSION_ID = "8" && ${PATCH_VERSION_ID} -ge "101" ]] ; then
if [[ "${DOTNET_BINARY}" = "" ]] || [[ $MAJOR_VERSION_ID != "8" ]] ; then
echo "'dotnet 8' was not detected. Attempting to install .NET 8 to build oryx."

# The oryx build fails with .Net 8.0.201, see https://github.com/devcontainers/images/issues/974
# Pinning it to a working version until the upstream Oryx repo updates the dependency
# install_dotnet_using_apt
PINNED_SDK_VERSION="8.0.101"
install_dotnet_with_script ${PINNED_SDK_VERSION}
install_dotnet_using_apt
# PINNED_SDK_VERSION="8.0.101"
# install_dotnet_with_script ${PINNED_SDK_VERSION}

if ! dotnet --version > /dev/null ; then
echo "(!) Please install Dotnet before installing Oryx"
exit 1
fi

DOTNET_BINARY="/usr/bin/dotnet"
fi

BUILD_SCRIPT_GENERATOR=/usr/local/buildscriptgen
Expand All @@ -192,7 +193,7 @@ echo "Building solution '$SOLUTION_FILE_NAME'..."
cd $GIT_ORYX
${DOTNET_BINARY} build "$SOLUTION_FILE_NAME" -c Debug

${DOTNET_BINARY} publish -property:ValidateExecutableReferencesMatchSelfContained=false -r linux-x64 -o ${BUILD_SCRIPT_GENERATOR} -c Release $GIT_ORYX/src/BuildScriptGeneratorCli/BuildScriptGeneratorCli.csproj
${DOTNET_BINARY} publish -property:ValidateExecutableReferencesMatchSelfContained=false -r linux-x64 -o ${BUILD_SCRIPT_GENERATOR} -c Release $GIT_ORYX/src/BuildScriptGeneratorCli/BuildScriptGeneratorCli.csproj --self-contained true
${DOTNET_BINARY} publish -r linux-x64 -o ${BUILD_SCRIPT_GENERATOR} -c Release $GIT_ORYX/src/BuildServer/BuildServer.csproj

chmod a+x ${BUILD_SCRIPT_GENERATOR}/GenerateBuildScript
Expand Down Expand Up @@ -248,4 +249,4 @@ fi
# Clean up
rm -rf /var/lib/apt/lists/*

echo "Done!"
echo "Done!"

0 comments on commit 7ba8681

Please sign in to comment.