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
4cd1e6b5
Commit
4cd1e6b5
authored
Jun 15, 2022
by
Samruddhi Khandale
Committed by
GitHub
Jun 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "add gradle feature"
This reverts commit
123ca465
.
parent
123ca465
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1 addition
and
173 deletions
+1
-173
test-all.yaml
.github/workflows/test-all.yaml
+0
-1
test-pr.yaml
.github/workflows/test-pr.yaml
+0
-1
devcontainer-feature.json
src/gradle/devcontainer-feature.json
+0
-29
install.sh
src/gradle/install.sh
+0
-129
test.sh
test/gradle/test.sh
+0
-11
feature-scripts.env
v1/feature-scripts.env
+1
-2
No files found.
.github/workflows/test-all.yaml
View file @
4cd1e6b5
...
...
@@ -25,7 +25,6 @@ jobs:
"
git-lfs"
,
"
github-cli"
,
"
go"
,
"
gradle"
"
hugo"
,
"
java"
,
"
kubectl-helm-minikube"
,
...
...
.github/workflows/test-pr.yaml
View file @
4cd1e6b5
...
...
@@ -25,7 +25,6 @@ jobs:
git-lfs: ./**/git-lfs/**
github-cli: ./**/github-cli/**
go: ./**/go/**
gradle: ./**/gradle/**
hugo: ./**/hugo/**
java: ./**/java/**
kubectl-helm-minikube: ./**/kubectl-helm-minikube/**
...
...
src/gradle/devcontainer-feature.json
deleted
100644 → 0
View file @
123ca465
{
"id"
:
"gradle"
,
"name"
:
"Gradle (via SDKMAN!)"
,
"options"
:
{
"version"
:
{
"type"
:
"string"
,
"proposals"
:
[
"latest"
,
"none"
,
"7"
,
"6"
,
"5"
],
"default"
:
"latest"
,
"description"
:
"Select or enter a Gradle version to install"
}
},
"extensions"
:
[
"vscjava.vscode-java-pack"
],
"containerEnv"
:
{
"SDKMAN_DIR"
:
"${SDKMAN_DIR:-
\"
/usr/local/sdkman
\"
}"
,
"PATH"
:
"${SDKMAN_DIR}/bin:${SDKMAN_DIR}/candidates/gradle/current/bin:${PATH}"
},
"install"
:
{
"app"
:
""
,
"file"
:
"install.sh"
}
}
src/gradle/install.sh
deleted
100644 → 0
View file @
123ca465
#!/usr/bin/env bash
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
GRADLE_VERSION
=
${
VERSION
:-
"latest"
}
USERNAME
=
${
USERNAME
:-
"automatic"
}
UPDATE_RC
=
${
UPDATE_RC
:-
"true"
}
export
SDKMAN_DIR
=
${
SDKMAN_DIR
:-
"/usr/local/sdkman"
}
set
-e
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
# Ensure that login shells get the correct path if the user updated the PATH using ENV.
rm
-f
/etc/profile.d/00-restore-env.sh
echo
"export PATH=
${
PATH
//
$(
sh
-lc
'echo $PATH'
)
/\
$PATH
}
"
>
/etc/profile.d/00-restore-env.sh
chmod
+x /etc/profile.d/00-restore-env.sh
# Determine the appropriate non-root user
if
[
"
${
USERNAME
}
"
=
"auto"
]
||
[
"
${
USERNAME
}
"
=
"automatic"
]
;
then
USERNAME
=
""
POSSIBLE_USERS
=(
"vscode"
"node"
"codespace"
"
$(
awk
-v
val
=
1000
-F
":"
'$3==val{print $1}'
/etc/passwd
)
"
)
for
CURRENT_USER
in
"
${
POSSIBLE_USERS
[@]
}
"
;
do
if
id
-u
${
CURRENT_USER
}
>
/dev/null 2>&1
;
then
USERNAME
=
${
CURRENT_USER
}
break
fi
done
if
[
"
${
USERNAME
}
"
=
""
]
;
then
USERNAME
=
root
fi
elif
[
"
${
USERNAME
}
"
=
"none"
]
||
!
id
-u
${
USERNAME
}
>
/dev/null 2>&1
;
then
USERNAME
=
root
fi
updaterc
()
{
if
[
"
${
UPDATE_RC
}
"
=
"true"
]
;
then
echo
"Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
if
[[
"
$(
cat
/etc/bash.bashrc
)
"
!=
*
"
$1
"
*
]]
;
then
echo
-e
"
$1
"
>>
/etc/bash.bashrc
fi
if
[
-f
"/etc/zsh/zshrc"
]
&&
[[
"
$(
cat
/etc/zsh/zshrc
)
"
!=
*
"
$1
"
*
]]
;
then
echo
-e
"
$1
"
>>
/etc/zsh/zshrc
fi
fi
}
# Function to run apt-get if needed
apt_get_update_if_needed
()
{
if
[
!
-d
"/var/lib/apt/lists"
]
||
[
"
$(
ls
/var/lib/apt/lists/ |
wc
-l
)
"
=
"0"
]
;
then
echo
"Running apt-get update..."
apt-get update
else
echo
"Skipping apt-get update."
fi
}
# Checks if packages are installed and installs them if not
check_packages
()
{
if
!
dpkg
-s
"
$@
"
>
/dev/null 2>&1
;
then
apt_get_update_if_needed
apt-get
-y
install
--no-install-recommends
"
$@
"
fi
}
# Use SDKMAN to install something using a partial version match
sdk_install
()
{
local
install_type
=
$1
local
requested_version
=
$2
local
prefix
=
$3
local
suffix
=
"
${
4
:-
"
\\
s*"
}
"
local
full_version_check
=
${
5
:-
".*-[a-z]+"
}
if
[
"
${
requested_version
}
"
=
"none"
]
;
then return
;
fi
# Blank will install latest stable version
if
[
"
${
requested_version
}
"
=
"lts"
]
||
[
"
${
requested_version
}
"
=
"default"
]
;
then
requested_version
=
""
elif
echo
"
${
requested_version
}
"
|
grep
-oE
"
${
full_version_check
}
"
>
/dev/null 2>&1
;
then
echo
"
${
requested_version
}
"
else
local
regex
=
"
${
prefix
}
\\
K[0-9]+
\\
.[0-9]+
\\
.[0-9]+
${
suffix
}
"
local
version_list
=
"
$(
.
${
SDKMAN_DIR
}
/bin/sdkman-init.sh
&&
sdk list
${
install_type
}
2>&1 |
grep
-oP
"
${
regex
}
"
|
tr
-d
' '
|
sort
-rV
)
"
if
[
"
${
requested_version
}
"
=
"latest"
]
||
[
"
${
requested_version
}
"
=
"current"
]
;
then
requested_version
=
"
$(
echo
"
${
version_list
}
"
|
head
-n
1
)
"
else
set
+e
requested_version
=
"
$(
echo
"
${
version_list
}
"
|
grep
-E
-m
1
"^
${
requested_version
//./\\.
}
([
\\
.
\\
s]|
$)
"
)
"
set
-e
fi
if
[
-z
"
${
requested_version
}
"
]
||
!
echo
"
${
version_list
}
"
|
grep
"^
${
requested_version
//./\\.
}
$"
>
/dev/null 2>&1
;
then
echo
-e
"Version
$2
not found. Available versions:
\n
${
version_list
}
"
>
&2
exit
1
fi
fi
su
${
USERNAME
}
-c
"umask 0002 && .
${
SDKMAN_DIR
}
/bin/sdkman-init.sh && sdk install
${
install_type
}
${
requested_version
}
&& sdk flush archives && sdk flush temp"
}
export
DEBIAN_FRONTEND
=
noninteractive
# Install dependencies
check_packages curl ca-certificates zip unzip
sed
# Install sdkman if not installed
if
[
!
-d
"
${
SDKMAN_DIR
}
"
]
;
then
# Create sdkman group, dir, and set sticky bit
if
!
cat
/etc/group |
grep
-e
"^sdkman:"
>
/dev/null 2>&1
;
then
groupadd
-r
sdkman
fi
usermod
-a
-G
sdkman
${
USERNAME
}
umask
0002
# Install SDKMAN
curl
-sSL
"https://get.sdkman.io?rcupdate=false"
| bash
chown
-R
:sdkman
${
SDKMAN_DIR
}
find
${
SDKMAN_DIR
}
-type
d | xargs
-d
'\n'
chmod
g+s
# Add sourcing of sdkman into bashrc/zshrc files (unless disabled)
updaterc
"export SDKMAN_DIR=
${
SDKMAN_DIR
}
\n
.
\$
{SDKMAN_DIR}/bin/sdkman-init.sh"
fi
# Install gradle
sdk_install gradle
${
GRADLE_VERSION
}
'\s\s'
'\s\s'
'^[0-9]+\.[0-9]+\.[0-9]+$'
updaterc
'[ -z "${GRADLE_USER_HOME}" ] && export GRADLE_USER_HOME=${HOME}/.gradle'
echo
"Done!"
test/gradle/test.sh
deleted
100644 → 0
View file @
123ca465
#!/bin/bash
set
-e
# Optional: Import test library
source
dev-container-features-test-lib
check
"version"
gradle
--version
# Report result
reportResults
\ No newline at end of file
v1/feature-scripts.env
View file @
4cd1e6b5
...
...
@@ -24,4 +24,3 @@ _BUILD_ARG_PHP="./php/install.sh ${_B
_BUILD_ARG_ORYX="./oryx/install.sh automatic true"
_BUILD_ARG_HUGO="./hugo/install.sh ${_BUILD_ARG_HUGO_VERSION:-latest} automatic true"
_BUILD_ARG_ANACONDA="./anaconda/install.sh ${_BUILD_ARG_ANACONDA_VERSION:-latest} automatic true"
\ No newline at end of file
_BUILD_ARG_GRADLE="./gradle/install.sh ${_BUILD_ARG_GRADLE_VERSION:-latest} automatic true"
\ No newline at end of file
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