Skip to content

Commit 7ae944e

Browse files
Merge pull request devcontainers#162 from devcontainers/samruddhikhandale/add-git-feature
Adds git Feature to images
2 parents 4c70a3e + d04652b commit 7ae944e

File tree

55 files changed

+449
-34
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+449
-34
lines changed

src/anaconda/.devcontainer/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"features": {
77
"ghcr.io/devcontainers/features/node:1": {
88
"version": "none"
9+
},
10+
"ghcr.io/devcontainers/features/git:1": {
11+
"version": "latest",
12+
"ppa": "false"
913
}
1014
},
1115
// Configure tool-specific properties.

src/anaconda/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.202.12",
2+
"version": "0.202.13",
33
"build": {
44
"latest": true,
55
"rootDistro": "debian",

src/anaconda/test-project/test.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ check "yapf" yapf --version
1616
check "pydocstyle" pydocstyle --version
1717
check "pycodestyle" pycodestyle --version
1818
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm --version"
19+
check "git" git --version
20+
21+
git_version_satisfied=false
22+
if (echo a version 2.38.1; git --version) | sort -Vk3 | tail -1 | grep -q git; then
23+
git_version_satisfied=true
24+
fi
25+
26+
check "git version satisfies requirement" echo $git_version_satisfied | grep "true"
1927

2028
# Report result
2129
reportResults

src/base-alpine/.devcontainer/library-scripts/common-alpine.sh

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,23 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
9595
which \
9696
ncdu \
9797
shadow \
98-
strace
98+
strace \
99+
make \
100+
zlib-dev \
101+
--no-cache \
102+
openssl-dev \
103+
curl-dev \
104+
expat-dev \
105+
asciidoc \
106+
xmlto \
107+
perl-error \
108+
perl-dev \
109+
tcl \
110+
tk \
111+
gcc \
112+
g++ \
113+
python3-dev \
114+
pcre2-dev
99115

100116
# Install man pages - package name varies between 3.12 and earlier versions
101117
if apk info man > /dev/null 2>&1; then
@@ -104,10 +120,24 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
104120
apk add --no-cache mandoc man-pages
105121
fi
106122

123+
# Temporarily install git from source until OSS feeds contains 2.38.1 or greater version.
107124
# Install git if not already installed (may be more recent than distro version)
108-
if ! type git > /dev/null 2>&1; then
109-
apk add --no-cache git
110-
fi
125+
# if ! type git > /dev/null 2>&1; then
126+
# apk add --no-cache git
127+
# fi
128+
129+
# Install latest version of git from source
130+
git_version_list="$(curl -sSL -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/git/git/tags" | grep -oP '"name":\s*"v\K[0-9]+\.[0-9]+\.[0-9]+"' | tr -d '"' | sort -rV )"
131+
GIT_VERSION="$(echo "${git_version_list}" | head -n 1)"
132+
133+
echo "Installing git v${GIT_VERSION}"
134+
curl -sL https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz | tar -xzC /tmp 2>&1
135+
pushd /tmp/git-${GIT_VERSION}
136+
make -s prefix=/usr/local all NO_REGEX=YesPlease NO_GETTEXT=YesPlease \
137+
&& make -s prefix=/usr/local NO_REGEX=YesPlease NO_GETTEXT=YesPlease install 2>&1
138+
139+
popd
140+
rm -rf /tmp/git-${GIT_VERSION}
111141

112142
PACKAGES_ALREADY_INSTALLED="true"
113143
fi

src/base-alpine/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.204.11",
2+
"version": "0.204.12",
33
"variants": [
44
"3.16",
55
"3.15",

src/base-alpine/test-project/test-utils-alpine.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ checkExtension() {
9090

9191
checkCommon()
9292
{
93-
PACKAGE_LIST="git \
94-
openssh-client \
93+
PACKAGE_LIST="openssh-client \
9594
gnupg \
9695
procps \
9796
lsof \

src/base-alpine/test-project/test.sh

100644100755
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,14 @@ source test-utils-alpine.sh vscode
66
# Run common tests
77
checkCommon
88

9+
check "git" git --version
10+
11+
git_version_satisfied=false
12+
if (echo a version 2.38.1; git --version) | sort -Vk3 | tail -1 | grep -q git; then
13+
git_version_satisfied=true
14+
fi
15+
16+
check "git version satisfies requirement" echo $git_version_satisfied | grep "true"
17+
918
# Report result
1019
reportResults

src/base-debian/.devcontainer/devcontainer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
"uid": "1000",
1111
"gid": "1000",
1212
"upgradePackages": "true"
13-
}
13+
},
14+
"ghcr.io/devcontainers/features/git:1": {
15+
"version": "latest",
16+
"ppa": "false"
17+
}
1418
},
1519
// Configure tool-specific properties.
1620
"customizations": {

src/base-debian/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.202.13",
2+
"version": "0.202.14",
33
"variants": [
44
"buster",
55
"bullseye",

src/base-debian/test-project/test.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,14 @@ source test-utils.sh vscode
66
# Run common tests
77
checkCommon
88

9+
check "git" git --version
10+
11+
git_version_satisfied=false
12+
if (echo a version 2.38.1; git --version) | sort -Vk3 | tail -1 | grep -q git; then
13+
git_version_satisfied=true
14+
fi
15+
16+
check "git version satisfies requirement" echo $git_version_satisfied | grep "true"
17+
918
# Report result
1019
reportResults

0 commit comments

Comments
 (0)