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
4 changes: 2 additions & 2 deletions src/common-utils/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "common-utils",
"version": "2.4.0",
"version": "2.4.1",
"name": "Common Utilities",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils",
"description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.",
Expand Down Expand Up @@ -66,4 +66,4 @@
"description": "Add packages from non-free Debian repository? (Debian only)"
}
}
}
}
9 changes: 6 additions & 3 deletions src/common-utils/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,12 @@ install_debian_packages() {
install_redhat_packages() {
local package_list=""
local remove_epel="false"
local install_cmd=dnf
if ! type dnf > /dev/null 2>&1; then
install_cmd=yum
local install_cmd=microdnf
if ! type microdnf > /dev/null 2>&1; then
install_cmd=dnf
if ! type dnf > /dev/null 2>&1; then
install_cmd=yum
fi
fi

if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
Expand Down
16 changes: 16 additions & 0 deletions test/common-utils/alma-8-minimal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

# Optional: Import test library
source dev-container-features-test-lib

# Definition specific tests
. /etc/os-release
check "non-root user" test "$(whoami)" = "devcontainer"
check "distro" test "${PLATFORM_ID}" = "platform:el8"
check "curl" curl --version
check "jq" jq --version

# Report result
reportResults
16 changes: 16 additions & 0 deletions test/common-utils/alma-8.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

# Optional: Import test library
source dev-container-features-test-lib

# Definition specific tests
. /etc/os-release
check "non-root user" test "$(whoami)" = "devcontainer"
check "distro" test "${PLATFORM_ID}" = "platform:el8"
check "curl" curl --version
check "jq" jq --version

# Report result
reportResults
16 changes: 16 additions & 0 deletions test/common-utils/alma-9-minimal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

# Optional: Import test library
source dev-container-features-test-lib

# Definition specific tests
. /etc/os-release
check "non-root user" test "$(whoami)" = "devcontainer"
check "distro" test "${PLATFORM_ID}" = "platform:el9"
check "curl" curl --version
check "jq" jq --version

# Report result
reportResults
16 changes: 16 additions & 0 deletions test/common-utils/alma-9.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

# Optional: Import test library
source dev-container-features-test-lib

# Definition specific tests
. /etc/os-release
check "non-root user" test "$(whoami)" = "devcontainer"
check "distro" test "${PLATFORM_ID}" = "platform:el9"
check "curl" curl --version
check "jq" jq --version

# Report result
reportResults
16 changes: 16 additions & 0 deletions test/common-utils/rocky-8-minimal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

# Optional: Import test library
source dev-container-features-test-lib

# Definition specific tests
. /etc/os-release
check "non-root user" test "$(whoami)" = "devcontainer"
check "distro" test "${PLATFORM_ID}" = "platform:el8"
check "curl" curl --version
check "jq" jq --version

# Report result
reportResults
16 changes: 16 additions & 0 deletions test/common-utils/rocky-9-minimal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

# Optional: Import test library
source dev-container-features-test-lib

# Definition specific tests
. /etc/os-release
check "non-root user" test "$(whoami)" = "devcontainer"
check "distro" test "${PLATFORM_ID}" = "platform:el9"
check "curl" curl --version
check "jq" jq --version

# Report result
reportResults
44 changes: 43 additions & 1 deletion test/common-utils/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,34 @@
"common-utils": {}
}
},
"alma-8": {
Comment thread
jdputschadi marked this conversation as resolved.
"image": "almalinux:8",
"remoteUser": "devcontainer",
"features": {
"common-utils": {}
}
},
"alma-9": {
Comment thread
jdputschadi marked this conversation as resolved.
"image": "almalinux:9",
"remoteUser": "devcontainer",
"features": {
"common-utils": {}
}
},
"alma-8-minimal": {
"image": "almalinux:8-minimal",
"remoteUser": "devcontainer",
"features": {
"common-utils": {}
}
},
"alma-9-minimal": {
"image": "almalinux:9-minimal",
"remoteUser": "devcontainer",
"features": {
"common-utils": {}
}
},
"rocky-8": {
"image": "rockylinux:8",
"remoteUser": "devcontainer",
Expand All @@ -55,6 +83,20 @@
"common-utils": {}
}
},
"rocky-8-minimal": {
"image": "rockylinux:8-minimal",
"remoteUser": "devcontainer",
"features": {
"common-utils": {}
}
},
"rocky-9-minimal": {
"image": "rockylinux:9-minimal",
"remoteUser": "devcontainer",
"features": {
"common-utils": {}
}
},
"fedora": {
"image": "fedora",
"remoteUser": "devcontainer",
Expand Down Expand Up @@ -209,4 +251,4 @@
"common-utils": {}
}
}
}
}