Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
devcontainer-features
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eazydevelop-devcontainer-temp
devcontainer-features
Commits
fad03b19
Unverified
Commit
fad03b19
authored
Apr 18, 2023
by
Samruddhi Khandale
Committed by
GitHub
Apr 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Oryx - Switch to .NET 7 (#522)
* Oryx - Switch to .NET 7 * fix test ; add test * fix test - back compat
parent
22377314
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
8 deletions
+70
-8
devcontainer-feature.json
src/oryx/devcontainer-feature.json
+3
-2
install.sh
src/oryx/install.sh
+10
-6
install_prev_dotnet_and_oryx.sh
test/oryx/install_prev_dotnet_and_oryx.sh
+47
-0
scenarios.json
test/oryx/scenarios.json
+10
-0
No files found.
src/oryx/devcontainer-feature.json
View file @
fad03b19
{
{
"id"
:
"oryx"
,
"id"
:
"oryx"
,
"version"
:
"1.
0.13
"
,
"version"
:
"1.
1.0
"
,
"name"
:
"Oryx"
,
"name"
:
"Oryx"
,
"description"
:
"Installs the oryx CLI"
,
"description"
:
"Installs the oryx CLI"
,
"documentationURL"
:
"https://github.com/devcontainers/features/tree/main/src/oryx"
,
"documentationURL"
:
"https://github.com/devcontainers/features/tree/main/src/oryx"
,
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
"PATH"
:
"/usr/local/oryx:${PATH}"
"PATH"
:
"/usr/local/oryx:${PATH}"
},
},
"installsAfter"
:
[
"installsAfter"
:
[
"ghcr.io/devcontainers/features/common-utils"
"ghcr.io/devcontainers/features/common-utils"
,
"ghcr.io/devcontainers/features/dotnet"
]
]
}
}
src/oryx/install.sh
View file @
fad03b19
...
@@ -74,7 +74,7 @@ install_dotnet_using_apt() {
...
@@ -74,7 +74,7 @@ install_dotnet_using_apt() {
echo
"Attempting to auto-install dotnet..."
echo
"Attempting to auto-install dotnet..."
install_from_microsoft_feed
=
false
install_from_microsoft_feed
=
false
apt_get_update
apt_get_update
DOTNET_INSTALLATION_PACKAGE
=
"dotnet
6
"
DOTNET_INSTALLATION_PACKAGE
=
"dotnet
7
"
apt-get
-yq
install
$DOTNET_INSTALLATION_PACKAGE
||
install_from_microsoft_feed
=
"true"
apt-get
-yq
install
$DOTNET_INSTALLATION_PACKAGE
||
install_from_microsoft_feed
=
"true"
if
[
"
${
install_from_microsoft_feed
}
"
=
"true"
]
;
then
if
[
"
${
install_from_microsoft_feed
}
"
=
"true"
]
;
then
...
@@ -82,7 +82,7 @@ install_dotnet_using_apt() {
...
@@ -82,7 +82,7 @@ install_dotnet_using_apt() {
curl
-sSL
${
MICROSOFT_GPG_KEYS_URI
}
| gpg
--dearmor
>
/usr/share/keyrings/microsoft-archive-keyring.gpg
curl
-sSL
${
MICROSOFT_GPG_KEYS_URI
}
| gpg
--dearmor
>
/usr/share/keyrings/microsoft-archive-keyring.gpg
echo
"deb [arch=
${
architecture
}
signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-
${
ID
}
-
${
VERSION_CODENAME
}
-prod
${
VERSION_CODENAME
}
main"
>
/etc/apt/sources.list.d/microsoft.list
echo
"deb [arch=
${
architecture
}
signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-
${
ID
}
-
${
VERSION_CODENAME
}
-prod
${
VERSION_CODENAME
}
main"
>
/etc/apt/sources.list.d/microsoft.list
apt-get update
-y
apt-get update
-y
DOTNET_INSTALLATION_PACKAGE
=
"dotnet-sdk-
6
.0"
DOTNET_INSTALLATION_PACKAGE
=
"dotnet-sdk-
7
.0"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE
=
"true"
apt-get
install
-yq
$DOTNET_INSTALLATION_PACKAGE
DOTNET_SKIP_FIRST_TIME_EXPERIENCE
=
"true"
apt-get
install
-yq
$DOTNET_INSTALLATION_PACKAGE
fi
fi
...
@@ -132,9 +132,9 @@ if dotnet --version > /dev/null ; then
...
@@ -132,9 +132,9 @@ if dotnet --version > /dev/null ; then
DOTNET_BINARY
=
$(
which dotnet
)
DOTNET_BINARY
=
$(
which dotnet
)
fi
fi
# Oryx needs to be built with .NET
6
# Oryx needs to be built with .NET
7
if
[[
"
${
DOTNET_BINARY
}
"
=
""
]]
||
[[
"
$(
dotnet
--version
)
"
!=
*
"
6
"
*
]]
;
then
if
[[
"
${
DOTNET_BINARY
}
"
=
""
]]
||
[[
"
$(
dotnet
--version
)
"
!=
*
"
7
"
*
]]
;
then
echo
"'dotnet
6' was not detected. Attempting to install .NET 6
to build oryx."
echo
"'dotnet
7' was not detected. Attempting to install .NET 7
to build oryx."
install_dotnet_using_apt
install_dotnet_using_apt
if
!
dotnet
--version
>
/dev/null
;
then
if
!
dotnet
--version
>
/dev/null
;
then
...
@@ -154,7 +154,11 @@ mkdir -p ${ORYX}
...
@@ -154,7 +154,11 @@ mkdir -p ${ORYX}
git clone
--depth
=
1 https://github.com/microsoft/Oryx
$GIT_ORYX
git clone
--depth
=
1 https://github.com/microsoft/Oryx
$GIT_ORYX
$GIT_ORYX
/build/buildSln.sh
SOLUTION_FILE_NAME
=
"Oryx.sln"
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
${
DOTNET_BINARY
}
publish
-r
linux-x64
-o
${
BUILD_SCRIPT_GENERATOR
}
-c
Release
$GIT_ORYX
/src/BuildServer/BuildServer.csproj
${
DOTNET_BINARY
}
publish
-r
linux-x64
-o
${
BUILD_SCRIPT_GENERATOR
}
-c
Release
$GIT_ORYX
/src/BuildServer/BuildServer.csproj
...
...
test/oryx/install_prev_dotnet_and_oryx.sh
0 → 100644
View file @
fad03b19
#!/bin/bash
set
-e
# Optional: Import test library
source
dev-container-features-test-lib
check
"Oryx version"
oryx
--version
check
"Dotnet is not removed if it is not installed by the Oryx Feature"
dotnet
--version
# Install platforms with oryx build tool
check
"oryx-install-dotnet-2.1"
oryx prep
--skip-detection
--platforms-and-versions
dotnet
=
2.1.30
check
"dotnet-2-installed-by-oryx"
ls
/opt/dotnet/ |
grep
2.1
check
"oryx-install-nodejs-12.22.11"
oryx prep
--skip-detection
--platforms-and-versions
nodejs
=
12.22.11
check
"nodejs-12.22.11-installed-by-oryx"
ls
/opt/nodejs/ |
grep
12.22.11
check
"oryx-install-php-7.3.25"
oryx prep
--skip-detection
--platforms-and-versions
php
=
7.3.25
check
"php-7.3.25-installed-by-oryx"
ls
/opt/php/ |
grep
7.3.25
check
"oryx-install-java-12.0.2"
oryx prep
--skip-detection
--platforms-and-versions
java
=
12.0.2
check
"java-12.0.2-installed-by-oryx"
ls
/opt/java/ |
grep
12.0.2
# Replicates Oryx's behavior for universal image
mkdir
-p
/opt/oryx
echo
"vso-focal"
>>
/opt/oryx/.imagetype
mkdir
-p
/opt/dotnet/lts
cp
-R
/usr/local/dotnet/current/dotnet /opt/dotnet/lts
cp
-R
/usr/local/dotnet/current/LICENSE.txt /opt/dotnet/lts
cp
-R
/usr/local/dotnet/current/ThirdPartyNotices.txt /opt/dotnet/lts
# Install platforms with oryx build tool
check
"oryx-install-dotnet-2.1-universal"
oryx prep
--skip-detection
--platforms-and-versions
dotnet
=
2.1.30
check
"dotnet-2-installed-by-oryx-universal"
ls
/opt/dotnet/ |
grep
2.1
check
"oryx-install-nodejs-12.22.11-universal"
oryx prep
--skip-detection
--platforms-and-versions
nodejs
=
12.22.11
check
"nodejs-12.22.11-installed-by-oryx-universal"
ls
/opt/nodejs/ |
grep
12.22.11
check
"oryx-install-php-7.3.25-universal"
oryx prep
--skip-detection
--platforms-and-versions
php
=
7.3.25
check
"php-7.3.25-installed-by-oryx-universal"
ls
/opt/php/ |
grep
7.3.25
check
"oryx-install-java-12.0.2-universal"
oryx prep
--skip-detection
--platforms-and-versions
java
=
12.0.2
check
"java-12.0.2-installed-by-oryx-universal"
ls
/opt/java/ |
grep
12.0.2
# Report result
reportResults
test/oryx/scenarios.json
View file @
fad03b19
{
{
"install_dotnet_and_oryx"
:
{
"install_dotnet_and_oryx"
:
{
"image"
:
"ubuntu:focal"
,
"features"
:
{
"dotnet"
:
{
"version"
:
"7"
,
"installUsingApt"
:
"false"
},
"oryx"
:
{}
}
},
"install_prev_dotnet_and_oryx"
:
{
"image"
:
"ubuntu:focal"
,
"image"
:
"ubuntu:focal"
,
"features"
:
{
"features"
:
{
"dotnet"
:
{
"dotnet"
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment