diff options
author | Samruddhi Khandale <skhandale@microsoft.com> | 2022-11-17 22:55:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-17 22:55:43 +0300 |
commit | 3fc9604ddadc34ec44651ce981cebc7bd77095e5 (patch) | |
tree | 46f1603423215c57744c7165d71fd78d53afd888 /src | |
parent | be4f0498e4ad7948804d4be70093c1da8722d222 (diff) |
Oryx: Build with .NET 6 (#298)
* Oryx: Install dotnet 3.1 runtime
* fix tests
* build with .NET 6 + add tests
* add tests
* fix tests
* shellcheck: nit
Diffstat (limited to 'src')
-rw-r--r-- | src/oryx/devcontainer-feature.json | 2 | ||||
-rwxr-xr-x | src/oryx/install.sh | 20 | ||||
-rw-r--r-- | src/python/devcontainer-feature.json | 2 | ||||
-rwxr-xr-x | src/python/install.sh | 2 |
4 files changed, 16 insertions, 10 deletions
diff --git a/src/oryx/devcontainer-feature.json b/src/oryx/devcontainer-feature.json index 2596bd9..5c64344 100644 --- a/src/oryx/devcontainer-feature.json +++ b/src/oryx/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "oryx", - "version": "1.0.11", + "version": "1.0.12", "name": "Oryx", "description": "Installs the oryx CLI", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/oryx", diff --git a/src/oryx/install.sh b/src/oryx/install.sh index 054983a..aa4af2c 100755 --- a/src/oryx/install.sh +++ b/src/oryx/install.sh @@ -116,9 +116,8 @@ echo "Installing Oryx..." # Ensure apt is in non-interactive to avoid prompts export DEBIAN_FRONTEND=noninteractive - # Install dependencies -check_packages git sudo curl ca-certificates apt-transport-https gnupg2 dirmngr libc-bin +check_packages git sudo curl ca-certificates apt-transport-https gnupg2 dirmngr libc-bin moreutils if ! cat /etc/group | grep -e "^oryx:" > /dev/null 2>&1; then groupadd -r oryx @@ -127,16 +126,23 @@ usermod -a -G oryx "${USERNAME}" # Required to decide if we want to clean up dotnet later. DOTNET_INSTALLATION_PACKAGE="" +DOTNET_BINARY="" + +if dotnet --version > /dev/null ; then + DOTNET_BINARY=$(which dotnet) +fi -# Install dotnet unless available -if ! dotnet --version > /dev/null ; then - echo "'dotnet' was not detected. Attempting to install the latest version of the dotnet sdk to build oryx." +# Oryx needs to be built with .NET 6 +if [[ "${DOTNET_BINARY}" = "" ]] || [[ "$(dotnet --version)" != *"6"* ]] ; then + echo "'dotnet 6' was not detected. Attempting to install .NET 6 to build oryx." install_dotnet_using_apt 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 @@ -150,8 +156,8 @@ git clone --depth=1 https://github.com/microsoft/Oryx $GIT_ORYX $GIT_ORYX/build/buildSln.sh -dotnet publish -property:ValidateExecutableReferencesMatchSelfContained=false -r linux-x64 -o ${BUILD_SCRIPT_GENERATOR} -c Release $GIT_ORYX/src/BuildScriptGeneratorCli/BuildScriptGeneratorCli.csproj -dotnet publish -r linux-x64 -o ${BUILD_SCRIPT_GENERATOR} -c Release $GIT_ORYX/src/BuildServer/BuildServer.csproj +${DOTNET_BINARY} publish -property:ValidateExecutableReferencesMatchSelfContained=false -r linux-x64 -o ${BUILD_SCRIPT_GENERATOR} -c Release $GIT_ORYX/src/BuildScriptGeneratorCli/BuildScriptGeneratorCli.csproj +${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 diff --git a/src/python/devcontainer-feature.json b/src/python/devcontainer-feature.json index fbbf62c..b96511b 100644 --- a/src/python/devcontainer-feature.json +++ b/src/python/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "python", - "version": "1.0.14", + "version": "1.0.15", "name": "Python", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/python", "description": "Installs the provided version of Python, as well as PIPX, and other common Python utilities. JupyterLab is conditionally installed with the python feature. Note: May require source code compilation.", diff --git a/src/python/install.sh b/src/python/install.sh index 79ab7de..d823cc9 100755 --- a/src/python/install.sh +++ b/src/python/install.sh @@ -17,7 +17,7 @@ export PIPX_HOME=${PIPX_HOME:-"/usr/local/py-utils"} USERNAME=${USERNAME:-"automatic"} UPDATE_RC=${UPDATE_RC:-"true"} -USE_ORYX_IF_AVAILABLE=${USE_ORYX_IF_AVAILABLE:-"true"} +USE_ORYX_IF_AVAILABLE=${USEORYXIFAVAILABLE:-"true"} INSTALL_JUPYTERLAB=${INSTALLJUPYTERLAB:-"false"} CONFIGURE_JUPYTERLAB_ALLOW_ORIGIN=${CONFIGUREJUPYTERLABALLOWORIGIN:-""} |