Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GraalVM Community Edition & GraalVM Native Image #2330

Merged
merged 25 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,8 @@ function Get-PipxVersion {
$pipxVersion = $Matches.Version
return "Pipx $pipxVersion"
}

function Get-GraalVMVersion {
$version = $GRAALVM_BIN/java --version | Out-String | Select-Object -First 2 | Take-OutputPart -Part 7
nikita-bykov marked this conversation as resolved.
Show resolved Hide resolved
return "GraalVM CE $version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ $toolsList = @(
(Get-GitVersion),
(Get-GitLFSVersion),
(Get-GitFTPVersion),
(Get-GraalVMVersion),
(Get-HavegedVersion),
(Get-HerokuVersion),
(Get-HHVMVersion),
Expand Down
24 changes: 24 additions & 0 deletions images/linux/scripts/installers/graalvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -e

#Install GraalVM
tmp_graalvm="/tmp/graalvm"
mkdir -p "$tmp_graalvm"
url=$(curl -s https://api.github.com/repos/graalvm/graalvm-ce-builds/releases/latest | jq -r '.assets[].browser_download_url | select(contains("graalvm-ce-java11-linux-amd64"))')
download_with_retries "$url" "$tmp_graalvm/graalvm-archive.tar.gz"
mkdir /usr/local/graalvm
nikita-bykov marked this conversation as resolved.
Show resolved Hide resolved
tar -xzf "$tmp_graalvm/graalvm-archive.tar.gz" -C /usr/local/graalvm
setEtcEnvironmentVariable "GRAALVM_BIN" /usr/local/graalvm/graal*/bin

#Install Native Image
$GRAALVM_BIN/gu install native-image
nikita-bykov marked this conversation as resolved.
Show resolved Hide resolved

# Run tests to determine that the software installed as expected
if [[ $($GRAALVM_BIN/java --version) != *"GraalVM"* ]]; then
nikita-bykov marked this conversation as resolved.
Show resolved Hide resolved
echo "GraalVM was not installed"
exit 1
fi

if ! command -v $GRAALVM_BIN/native-image; then
nikita-bykov marked this conversation as resolved.
Show resolved Hide resolved
echo "Native Image was not installed"
exit 1
fi
3 changes: 2 additions & 1 deletion images/linux/ubuntu2004.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@
"{{template_dir}}/scripts/installers/android.sh",
"{{template_dir}}/scripts/installers/azpowershell.sh",
"{{template_dir}}/scripts/installers/pypy.sh",
"{{template_dir}}/scripts/installers/python.sh"
"{{template_dir}}/scripts/installers/python.sh",
"{{template_dir}}/scripts/installers/graalvm.sh"
],
"environment_vars": [
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
Expand Down