Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/test-pr-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ on:
- "src/powershell/**"
- "test/powershell/**"
- "src/docker-in-docker/**"
- "test/docker-in-docker/**"
- "test/docker-in-docker/**"
- "src/oryx/**"
- "test/oryx/**"

jobs:
detect-changes:
Expand All @@ -26,6 +28,7 @@ jobs:
filters: |
powershell: ./**/powershell/**
docker-in-docker: ./**/docker-in-docker/**
oryx: ./**/oryx/**

test:
needs: [detect-changes]
Expand All @@ -49,7 +52,11 @@ jobs:
- features: docker-in-docker
baseImage: mcr.microsoft.com/devcontainers/base:debian
- features: docker-in-docker
baseImage: mcr.microsoft.com/devcontainers/base:ubuntu
baseImage: mcr.microsoft.com/devcontainers/base:ubuntu
- features: oryx
baseImage: ubuntu:jammy
- features: oryx
baseImage: mcr.microsoft.com/devcontainers/base:ubuntu
steps:
- uses: actions/checkout@v7

Expand Down
2 changes: 1 addition & 1 deletion src/oryx/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "oryx",
"version": "2.0.2",
"version": "2.0.3",
"name": "Oryx",
"description": "Installs the oryx CLI",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/oryx",
Expand Down
14 changes: 12 additions & 2 deletions src/oryx/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ install_dotnet_using_apt() {
. /etc/os-release
architecture="$(dpkg --print-architecture)"

# Publish Oryx for the architecture it will run on
case "${architecture}" in
amd64) DOTNET_RUNTIME_ID="linux-x64" ;;
arm64) DOTNET_RUNTIME_ID="linux-arm64" ;;
*)
echo "(!) Architecture ${architecture} unsupported"
exit 1
;;
esac

# Currently, oryx is not supported with "jammy"
if [[ "jammy" = *"${VERSION_CODENAME}"* ]]; then
echo "(!) Unsupported distribution version '${VERSION_CODENAME}'."
Expand Down Expand Up @@ -188,8 +198,8 @@ echo "Publishing Oryx applications..."

cd $GIT_ORYX

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

find "${BUILD_SCRIPT_GENERATOR}" -maxdepth 1 -type f \
\( -name '*.pdb' -o -name 'Microsoft.Oryx.*.xml' -o -name 'GenerateBuildScript.xml' \) -delete
Expand Down
22 changes: 22 additions & 0 deletions test/oryx/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,29 @@ set -e
# Optional: Import test library
source dev-container-features-test-lib

# Checks if packages are installed and installs them if not
check_packages() {
if ! dpkg -s "$@" > /dev/null 2>&1; then
local sudo_cmd=""
if [ "$(id -u)" -ne 0 ]; then
sudo_cmd="sudo"
fi
${sudo_cmd} apt-get update -y
${sudo_cmd} apt-get -y install --no-install-recommends "$@"
fi
}

check_packages file

check "Oryx version" oryx --version
check "oryx-binary-matches-architecture" bash -c '
Comment thread
fairuzan marked this conversation as resolved.
Resolved
case "$(uname -m)" in
x86_64) expected="x86-64" ;;
aarch64) expected="ARM aarch64" ;;
*) exit 1 ;;
esac
file -L "$(command -v oryx)" | grep -q "${expected}"
'
check "ORYX_SDK_STORAGE_BASE_URL" echo $ORYX_SDK_STORAGE_BASE_URL
check "ENABLE_DYNAMIC_INSTALL" echo $ENABLE_DYNAMIC_INSTALL

Expand Down
Loading