From 9a6b8dd92ae3148313d0f4eb60711ea6076646e5 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Mon, 31 May 2021 18:53:04 +0300 Subject: [PATCH 1/3] Change rebar installation to use gh releases --- images/linux/scripts/installers/erlang.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/images/linux/scripts/installers/erlang.sh b/images/linux/scripts/installers/erlang.sh index b65b545aeea0..7fddf0d2ebc4 100644 --- a/images/linux/scripts/installers/erlang.sh +++ b/images/linux/scripts/installers/erlang.sh @@ -13,9 +13,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" From fe5f94f6ccb9d927aafa6880296cae550b068e98 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Mon, 31 May 2021 22:07:25 +0300 Subject: [PATCH 2/3] Add source $HELPER_SCRIPTS/install.sh --- images/linux/scripts/installers/erlang.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/images/linux/scripts/installers/erlang.sh b/images/linux/scripts/installers/erlang.sh index 7fddf0d2ebc4..73c973aa3276 100644 --- a/images/linux/scripts/installers/erlang.sh +++ b/images/linux/scripts/installers/erlang.sh @@ -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 From de32e159e6ab81d85ec951cc0a37666d014bafe5 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Tue, 1 Jun 2021 12:27:07 +0300 Subject: [PATCH 3/3] Add Erlang rebar3 to software readme --- .../scripts/SoftwareReport/SoftwareReport.Common.psm1 | 7 +++++++ .../scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 1 + 2 files changed, 8 insertions(+) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 index a2ebebcb3037..7f9e8af243f2 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -56,6 +56,13 @@ function Get-ErlangVersion { return "Erlang $erlangVersion (Eshell $shellVersion)" } +function Get-ErlangRebar3Version { + $result = Get-CommandResult "rebar3 --version" + $result.Output -match "rebar (?(\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" diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 551569a1d582..efe543050a1f 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -42,6 +42,7 @@ $markdown += New-MDList -Style Unordered -Lines (@( (Get-ClangVersions), (Get-ClangFormatVersions), (Get-ErlangVersion), + (Get-ErlangRebar3Version), (Get-MonoVersion), (Get-MsbuildVersion), (Get-NodeVersion),