From 97565a7e60cbdf7fa1e2d079e260d875f2cd11ed Mon Sep 17 00:00:00 2001 From: Jeff Putsch <150963136+jdputschadi@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:49:46 -0800 Subject: [PATCH] Add RHEL support to git feature (#782) * Git feature passes all tests: existing + rhel-based base images: centos7, alma-{8,9}, alma-{8,9}-minimal * update per PR comments * Fix apt typo... * udpate per PR code review * revert README.md * update per samruddhikhandale's feedback. * Update src/git/install.sh Co-authored-by: Samruddhi Khandale * stop non-fatal error messages in RHEL tests. * remove tests for alma-[89]-minimal base images for now. * add install system git tests for RHEL base images * *_system_* tests install from system repositories, not latest version * fix broken install_git_from_system_mariner test * fix broken install_git_from_system_mariner test --------- Co-authored-by: Jeff Putsch Co-authored-by: Samruddhi Khandale --- src/git/NOTES.md | 2 +- src/git/devcontainer-feature.json | 6 +- src/git/install.sh | 154 +++++++++++++++---- test/common-utils/alma-minimal-8.sh | 16 ++ test/common-utils/alma-minimal-9.sh | 16 ++ test/git/install_git_from_src.sh | 1 + test/git/install_git_from_src_alma-8.sh | 16 ++ test/git/install_git_from_src_alma-9.sh | 16 ++ test/git/install_git_from_src_bionic.sh | 1 + test/git/install_git_from_src_bullseye.sh | 1 + test/git/install_git_from_src_buster.sh | 1 + test/git/install_git_from_src_centos-7.sh | 16 ++ test/git/install_git_from_src_fedora.sh | 16 ++ test/git/install_git_from_src_jammy.sh | 1 + test/git/install_git_from_src_mariner.sh | 16 ++ test/git/install_git_from_src_rocky-8.sh | 16 ++ test/git/install_git_from_src_rocky-9.sh | 16 ++ test/git/install_git_from_system_alma-8.sh | 16 ++ test/git/install_git_from_system_alma-9.sh | 16 ++ test/git/install_git_from_system_centos-7.sh | 16 ++ test/git/install_git_from_system_fedora.sh | 16 ++ test/git/install_git_from_system_mariner.sh | 15 ++ test/git/install_git_from_system_rocky-8.sh | 16 ++ test/git/install_git_from_system_rocky-9.sh | 16 ++ test/git/scenarios.json | 128 ++++++++++++++- 25 files changed, 513 insertions(+), 37 deletions(-) mode change 100755 => 100644 src/git/install.sh create mode 100755 test/common-utils/alma-minimal-8.sh create mode 100755 test/common-utils/alma-minimal-9.sh create mode 100644 test/git/install_git_from_src_alma-8.sh create mode 100644 test/git/install_git_from_src_alma-9.sh create mode 100644 test/git/install_git_from_src_centos-7.sh create mode 100644 test/git/install_git_from_src_fedora.sh create mode 100644 test/git/install_git_from_src_mariner.sh create mode 100644 test/git/install_git_from_src_rocky-8.sh create mode 100644 test/git/install_git_from_src_rocky-9.sh create mode 100644 test/git/install_git_from_system_alma-8.sh create mode 100644 test/git/install_git_from_system_alma-9.sh create mode 100644 test/git/install_git_from_system_centos-7.sh create mode 100644 test/git/install_git_from_system_fedora.sh create mode 100644 test/git/install_git_from_system_mariner.sh create mode 100644 test/git/install_git_from_system_rocky-8.sh create mode 100644 test/git/install_git_from_system_rocky-9.sh diff --git a/src/git/NOTES.md b/src/git/NOTES.md index 19fe92f31..e809f2099 100644 --- a/src/git/NOTES.md +++ b/src/git/NOTES.md @@ -2,6 +2,6 @@ ## OS Support -This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. +This Feature should work on recent versions of Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and RockyLinux distributions with the `apt`, `yum`, `dnf`, or `microdnf` package manager installed. `bash` is required to execute the `install.sh` script. diff --git a/src/git/devcontainer-feature.json b/src/git/devcontainer-feature.json index 8cbca6cf8..8d88c4f3b 100644 --- a/src/git/devcontainer-feature.json +++ b/src/git/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "git", - "version": "1.1.6", + "version": "1.2.0", "name": "Git (from source)", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/git", "description": "Install an up-to-date version of Git, built from source as needed. Useful for when you want the latest and greatest features. Auto-detects latest stable version and installs needed dependencies.", @@ -17,10 +17,10 @@ "ppa": { "type": "boolean", "default": true, - "description": "Install from PPA if available" + "description": "Install from PPA if available (only supported for Ubuntu distributions)" } }, "installsAfter": [ "ghcr.io/devcontainers/features/common-utils" ] -} +} \ No newline at end of file diff --git a/src/git/install.sh b/src/git/install.sh old mode 100755 new mode 100644 index 67338b8da..8a0731933 --- a/src/git/install.sh +++ b/src/git/install.sh @@ -16,16 +16,51 @@ keyserver hkp://keyserver.ubuntu.com:80 keyserver hkps://keys.openpgp.org keyserver hkp://keyserver.pgp.com" -set -e - -# Clean up -rm -rf /var/lib/apt/lists/* - if [ "$(id -u)" -ne 0 ]; then echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' exit 1 fi +# Bring in ID, ID_LIKE, VERSION_ID, VERSION_CODENAME +. /etc/os-release +# Get an adjusted ID independent of distro variants +if [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then + ADJUSTED_ID="debian" +elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "mariner" || "${ID_LIKE}" = *"rhel"* || "${ID_LIKE}" = *"fedora"* || "${ID_LIKE}" = *"mariner"* ]]; then + ADJUSTED_ID="rhel" + VERSION_CODENAME="${ID}{$VERSION_ID}" +else + echo "Linux distro ${ID} not supported." + exit 1 +fi + +if type apt-get > /dev/null 2>&1; then + INSTALL_CMD=apt-get +elif type microdnf > /dev/null 2>&1; then + INSTALL_CMD=microdnf +elif type dnf > /dev/null 2>&1; then + INSTALL_CMD=dnf +elif type yum > /dev/null 2>&1; then + INSTALL_CMD=yum +else + echo "(Error) Unable to find a supported package manager." + exit 1 +fi + +# Clean up +clean_up() { + case $ADJUSTED_ID in + debian) + rm -rf /var/lib/apt/lists/* + ;; + rhel) + rm -rf /var/cache/dnf/* + rm -rf /var/cache/yum/* + ;; + esac +} +clean_up + # Import the specified key in a variable name passed in as receive_gpg_keys() { local keys=${!1} @@ -61,40 +96,73 @@ receive_gpg_keys() { fi } -apt_get_update() -{ - if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then - echo "Running apt-get update..." - apt-get update -y +pkg_mgr_update() { + if [ ${INSTALL_CMD} = "apt-get" ]; then + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + ${INSTALL_CMD} update -y + fi + elif [ ${INSTALL_CMD} = "dnf" ] || [ ${INSTALL_CMD} = "yum" ]; then + if [ "$(find /var/cache/${INSTALL_CMD}/* | wc -l)" = "0" ]; then + echo "Running ${INSTALL_CMD} check-update ..." + ${INSTALL_CMD} check-update + fi fi } + # Checks if packages are installed and installs them if not check_packages() { - if ! dpkg -s "$@" > /dev/null 2>&1; then - apt_get_update - apt-get -y install --no-install-recommends "$@" + if [ ${INSTALL_CMD} = "apt-get" ]; then + if ! dpkg -s "$@" > /dev/null 2>&1; then + pkg_mgr_update + ${INSTALL_CMD} -y install --no-install-recommends "$@" + fi + elif [ ${INSTALL_CMD} = "dnf" ] || [ ${INSTALL_CMD} = "yum" ]; then + _num_pkgs=$(echo "$@" | tr ' ' \\012 | wc -l) + _num_installed=$(${INSTALL_CMD} -C list installed "$@" | sed '1,/^Installed/d' | wc -l) + if [ ${_num_pkgs} != ${_num_installed} ]; then + pkg_mgr_update + ${INSTALL_CMD} -y install "$@" + fi + elif [ ${INSTALL_CMD} = "microdnf" ]; then + ${INSTALL_CMD} -y install \ + --refresh \ + --best \ + --nodocs \ + --noplugins \ + --setopt=install_weak_deps=0 \ + "$@" + else + echo "Linux distro ${ID} not supported." + exit 1 fi } export DEBIAN_FRONTEND=noninteractive -# Source /etc/os-release to get OS info -. /etc/os-release +# Debian / Ubuntu packages # If the os provided version is "good enough", just install that. if [ ${GIT_VERSION} = "os-provided" ] || [ ${GIT_VERSION} = "system" ]; then if type git > /dev/null 2>&1; then echo "Detected existing system install: $(git version)" # Clean up - rm -rf /var/lib/apt/lists/* + clean_up exit 0 fi - echo "Installing git from OS apt repository" + if [ "$INSTALL_CMD" = "apt-get" ]; then + echo "Installing git from OS apt repository" + else + echo "Installing git from OS yum/dnf repository" + fi + if [ $ID = "mariner" ]; then + check_packages ca-certificates + fi check_packages git # Clean up - rm -rf /var/lib/apt/lists/* + clean_up exit 0 fi @@ -104,15 +172,47 @@ if ([ "${GIT_VERSION}" = "latest" ] || [ "${GIT_VERSION}" = "lts" ] || [ "${GIT_ check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr receive_gpg_keys GIT_CORE_PPA_ARCHIVE_GPG_KEY /usr/share/keyrings/gitcoreppa-archive-keyring.gpg echo -e "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitcoreppa-archive-keyring.gpg] http://ppa.launchpad.net/git-core/ppa/ubuntu ${VERSION_CODENAME} main\ndeb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitcoreppa-archive-keyring.gpg] http://ppa.launchpad.net/git-core/ppa/ubuntu ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/git-core-ppa.list - apt-get update - apt-get -y install --no-install-recommends git + ${INSTALL_CMD} update + ${INSTALL_CMD} -y install --no-install-recommends git rm -rf "/tmp/tmp-gnupg" rm -rf /var/lib/apt/lists/* exit 0 fi # Install required packages to build if missing -check_packages build-essential curl ca-certificates tar gettext libssl-dev zlib1g-dev libcurl?-openssl-dev libexpat1-dev +if [ "${ADJUSTED_ID}" = "debian" ]; then + + check_packages build-essential curl ca-certificates tar gettext libssl-dev zlib1g-dev libcurl?-openssl-dev libexpat1-dev + + check_packages libpcre2-dev + + if [ "${VERSION_CODENAME}" = "focal" ] || [ "${VERSION_CODENAME}" = "bullseye" ]; then + check_packages libpcre2-posix2 + elif [ "${VERSION_CODENAME}" = "bionic" ] || [ "${VERSION_CODENAME}" = "buster" ]; then + check_packages libpcre2-posix0 + else + check_packages libpcre2-posix3 + fi + +elif [ "${ADJUSTED_ID}" = "rhel" ]; then + + if [ $VERSION_CODENAME = "centos7" ]; then + check_packages centos-release-scl + check_packages devtoolset-11 + source /opt/rh/devtoolset-11/enable + else + check_packages gcc + fi + + + check_packages libcurl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel cmake pcre2-devel tar gzip ca-certificates + if ! type curl > /dev/null 2>&1; then + check_packages curl + fi + if [ $ID = "mariner" ]; then + check_packages glibc-devel kernel-headers binutils + fi +fi # Partial version matching if [ "$(echo "${GIT_VERSION}" | grep -o '\.' | wc -l)" != "2" ]; then @@ -131,21 +231,11 @@ if [ "$(echo "${GIT_VERSION}" | grep -o '\.' | wc -l)" != "2" ]; then fi fi -check_packages libpcre2-dev - -if [ "${VERSION_CODENAME}" = "focal" ] || [ "${VERSION_CODENAME}" = "bullseye" ]; then - check_packages libpcre2-posix2 -elif [ "${VERSION_CODENAME}" = "bionic" ] || [ "${VERSION_CODENAME}" = "buster" ]; then - check_packages libpcre2-posix0 -else - check_packages libpcre2-posix3 -fi - echo "Downloading source for ${GIT_VERSION}..." curl -sL https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz | tar -xzC /tmp 2>&1 echo "Building..." cd /tmp/git-${GIT_VERSION} make -s USE_LIBPCRE=YesPlease prefix=/usr/local sysconfdir=/etc all && make -s USE_LIBPCRE=YesPlease prefix=/usr/local sysconfdir=/etc install 2>&1 rm -rf /tmp/git-${GIT_VERSION} -rm -rf /var/lib/apt/lists/* +clean_up echo "Done!" diff --git a/test/common-utils/alma-minimal-8.sh b/test/common-utils/alma-minimal-8.sh new file mode 100755 index 000000000..cb2b339e1 --- /dev/null +++ b/test/common-utils/alma-minimal-8.sh @@ -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 \ No newline at end of file diff --git a/test/common-utils/alma-minimal-9.sh b/test/common-utils/alma-minimal-9.sh new file mode 100755 index 000000000..cb2b339e1 --- /dev/null +++ b/test/common-utils/alma-minimal-9.sh @@ -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 \ No newline at end of file diff --git a/test/git/install_git_from_src.sh b/test/git/install_git_from_src.sh index c3552240d..d0ebaa282 100644 --- a/test/git/install_git_from_src.sh +++ b/test/git/install_git_from_src.sh @@ -5,6 +5,7 @@ set -e # Optional: Import test library source dev-container-features-test-lib +# Definition specific tests check "version" git --version check "gettext" dpkg-query -l gettext diff --git a/test/git/install_git_from_src_alma-8.sh b/test/git/install_git_from_src_alma-8.sh new file mode 100644 index 000000000..84800b543 --- /dev/null +++ b/test/git/install_git_from_src_alma-8.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/install_git_from_src_alma-9.sh b/test/git/install_git_from_src_alma-9.sh new file mode 100644 index 000000000..84800b543 --- /dev/null +++ b/test/git/install_git_from_src_alma-9.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/install_git_from_src_bionic.sh b/test/git/install_git_from_src_bionic.sh index 4bdcf3066..6a1f639cf 100644 --- a/test/git/install_git_from_src_bionic.sh +++ b/test/git/install_git_from_src_bionic.sh @@ -5,6 +5,7 @@ set -e # Optional: Import test library source dev-container-features-test-lib +# Definition specific tests check "version" git --version check "gettext" dpkg-query -l gettext diff --git a/test/git/install_git_from_src_bullseye.sh b/test/git/install_git_from_src_bullseye.sh index 4bdcf3066..6a1f639cf 100644 --- a/test/git/install_git_from_src_bullseye.sh +++ b/test/git/install_git_from_src_bullseye.sh @@ -5,6 +5,7 @@ set -e # Optional: Import test library source dev-container-features-test-lib +# Definition specific tests check "version" git --version check "gettext" dpkg-query -l gettext diff --git a/test/git/install_git_from_src_buster.sh b/test/git/install_git_from_src_buster.sh index 4bdcf3066..6a1f639cf 100644 --- a/test/git/install_git_from_src_buster.sh +++ b/test/git/install_git_from_src_buster.sh @@ -5,6 +5,7 @@ set -e # Optional: Import test library source dev-container-features-test-lib +# Definition specific tests check "version" git --version check "gettext" dpkg-query -l gettext diff --git a/test/git/install_git_from_src_centos-7.sh b/test/git/install_git_from_src_centos-7.sh new file mode 100644 index 000000000..84800b543 --- /dev/null +++ b/test/git/install_git_from_src_centos-7.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/install_git_from_src_fedora.sh b/test/git/install_git_from_src_fedora.sh new file mode 100644 index 000000000..84800b543 --- /dev/null +++ b/test/git/install_git_from_src_fedora.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/install_git_from_src_jammy.sh b/test/git/install_git_from_src_jammy.sh index 4bdcf3066..6a1f639cf 100644 --- a/test/git/install_git_from_src_jammy.sh +++ b/test/git/install_git_from_src_jammy.sh @@ -5,6 +5,7 @@ set -e # Optional: Import test library source dev-container-features-test-lib +# Definition specific tests check "version" git --version check "gettext" dpkg-query -l gettext diff --git a/test/git/install_git_from_src_mariner.sh b/test/git/install_git_from_src_mariner.sh new file mode 100644 index 000000000..84800b543 --- /dev/null +++ b/test/git/install_git_from_src_mariner.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/install_git_from_src_rocky-8.sh b/test/git/install_git_from_src_rocky-8.sh new file mode 100644 index 000000000..84800b543 --- /dev/null +++ b/test/git/install_git_from_src_rocky-8.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/install_git_from_src_rocky-9.sh b/test/git/install_git_from_src_rocky-9.sh new file mode 100644 index 000000000..84800b543 --- /dev/null +++ b/test/git/install_git_from_src_rocky-9.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/install_git_from_system_alma-8.sh b/test/git/install_git_from_system_alma-8.sh new file mode 100644 index 000000000..84800b543 --- /dev/null +++ b/test/git/install_git_from_system_alma-8.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/install_git_from_system_alma-9.sh b/test/git/install_git_from_system_alma-9.sh new file mode 100644 index 000000000..84800b543 --- /dev/null +++ b/test/git/install_git_from_system_alma-9.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/install_git_from_system_centos-7.sh b/test/git/install_git_from_system_centos-7.sh new file mode 100644 index 000000000..84800b543 --- /dev/null +++ b/test/git/install_git_from_system_centos-7.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/install_git_from_system_fedora.sh b/test/git/install_git_from_system_fedora.sh new file mode 100644 index 000000000..84800b543 --- /dev/null +++ b/test/git/install_git_from_system_fedora.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/install_git_from_system_mariner.sh b/test/git/install_git_from_system_mariner.sh new file mode 100644 index 000000000..2114dfdf6 --- /dev/null +++ b/test/git/install_git_from_system_mariner.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +# Ensure git clone works, i.e. ca-certificates are installed. +check "git clone" bash -c "cd /tmp && git clone https://github.com/devcontainers/feature-starter.git" + +# Report result +reportResults diff --git a/test/git/install_git_from_system_rocky-8.sh b/test/git/install_git_from_system_rocky-8.sh new file mode 100644 index 000000000..84800b543 --- /dev/null +++ b/test/git/install_git_from_system_rocky-8.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/install_git_from_system_rocky-9.sh b/test/git/install_git_from_system_rocky-9.sh new file mode 100644 index 000000000..84800b543 --- /dev/null +++ b/test/git/install_git_from_system_rocky-9.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" git --version + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/scenarios.json b/test/git/scenarios.json index 22af7a860..583c1adbe 100644 --- a/test/git/scenarios.json +++ b/test/git/scenarios.json @@ -43,5 +43,131 @@ "ppa": "false" } } + }, + "install_git_from_src_centos-7": { + "image": "centos:centos7", + "features": { + "git": { + "version": "latest", + "ppa": "false" + } + } + }, + "install_git_from_src_alma-8": { + "image": "almalinux:8", + "features": { + "git": { + "version": "latest", + "ppa": "false" + } + } + }, + "install_git_from_src_alma-9": { + "image": "almalinux:9", + "features": { + "git": { + "version": "latest", + "ppa": "false" + } + } + }, + "install_git_from_src_rocky-8": { + "image": "rockylinux:8", + "features": { + "git": { + "version": "latest", + "ppa": "false" + } + } + }, + "install_git_from_src_rocky-9": { + "image": "rockylinux:9", + "features": { + "git": { + "version": "latest", + "ppa": "false" + } + } + }, + "install_git_from_src_fedora": { + "image": "fedora", + "features": { + "git": { + "version": "latest", + "ppa": "false" + } + } + }, + "install_git_from_src_mariner": { + "image": "mcr.microsoft.com/cbl-mariner/base/core:2.0", + "features": { + "git": { + "version": "latest", + "ppa": "false" + } + } + }, + "install_git_from_system_centos-7": { + "image": "centos:centos7", + "features": { + "git": { + "version": "system", + "ppa": "true" + } + } + }, + "install_git_from_system_alma-8": { + "image": "almalinux:8", + "features": { + "git": { + "version": "system", + "ppa": "true" + } + } + }, + "install_git_from_system_alma-9": { + "image": "almalinux:9", + "features": { + "git": { + "version": "system", + "ppa": "true" + } + } + }, + "install_git_from_system_rocky-8": { + "image": "rockylinux:8", + "features": { + "git": { + "version": "system", + "ppa": "true" + } + } + }, + "install_git_from_system_rocky-9": { + "image": "rockylinux:9", + "features": { + "git": { + "version": "system", + "ppa": "true" + } + } + }, + "install_git_from_system_fedora": { + "image": "fedora", + "features": { + "git": { + "version": "system", + "ppa": "true" + } + } + }, + "install_git_from_system_mariner": { + "image": "mcr.microsoft.com/cbl-mariner/base/core:2.0", + "features": { + "git": { + "version": "system", + "ppa": "true" + } + } } -} +} \ No newline at end of file