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

[Ubuntu] Change rebar installation to use GitHub releases #3486

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
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ function Get-ErlangVersion {
return "Erlang $erlangVersion (Eshell $shellVersion)"
}

function Get-ErlangRebar3Version {
$result = Get-CommandResult "rebar3 --version"
$result.Output -match "rebar (?<version>(\d+.){2}\d+)" | Out-Null
$rebarVersion = $Matches.version
return "Erlang rebar3 $rebarVersion"
}

function Get-MonoVersion {
$monoVersion = mono --version | Out-String | Take-OutputPart -Part 4
$aptSourceRepo = Get-AptSourceRepository -PackageName "mono"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ $markdown += New-MDList -Style Unordered -Lines (@(
(Get-ClangVersions),
(Get-ClangFormatVersions),
(Get-ErlangVersion),
(Get-ErlangRebar3Version),
(Get-MonoVersion),
(Get-MsbuildVersion),
(Get-NodeVersion),
Expand Down
12 changes: 9 additions & 3 deletions images/linux/scripts/installers/erlang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
## Desc: Installs erlang
################################################################################

# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh

source_list=/etc/apt/sources.list.d/eslerlang.list

# Install Erlang
Expand All @@ -13,9 +16,12 @@ apt-get update
apt-get install -y --no-install-recommends esl-erlang

# Install rebar3
wget -q -O rebar3 https://s3.amazonaws.com/rebar3/rebar3
chmod +x rebar3
mv rebar3 /usr/local/bin/rebar3
json=$(curl -sL "https://api.github.com/repos/erlang/rebar3/releases")
rebar3Version=$(echo $json | jq -r '.[] | select(.tag_name | contains("-") | not).tag_name' | sort -V | tail -n1)
rebar3DownloadUrl=$(echo $json | jq -r ".[] | select(.tag_name==\"$rebar3Version\").assets[].browser_download_url")
download_with_retries $rebar3DownloadUrl "/tmp"
mv /tmp/rebar3 /usr/local/bin/rebar3
chmod +x /usr/local/bin/rebar3

invoke_tests "Tools" "erlang"

Expand Down