diff --git a/images/linux/scripts/installers/julia.sh b/images/linux/scripts/installers/julia.sh index 1ca450320..a576a5405 100644 --- a/images/linux/scripts/installers/julia.sh +++ b/images/linux/scripts/installers/julia.sh @@ -23,17 +23,18 @@ function GetLatestJuliaRelease () { function InstallJulia () { # Extract Major and Minor version from full version string - juliaMajorAndMinorVersion="$(sed 's/\.[^.]*$//' <<< $1)" + juliaMajorAndMinorVersion="$(cut -d. -f1,2 <<< $1)" + juliaInstallationPath="/usr/local/julia$1" curl -sL "https://julialang-s3.julialang.org/bin/linux/x64/$juliaMajorAndMinorVersion/julia-$1-linux-x86_64.tar.gz" -o "julia-$1-linux-x86_64.tar.gz" - mkdir -p "/usr/local/julia$juliaMajorAndMinorVersion" - tar -C "/usr/local/julia$juliaMajorAndMinorVersion" -xzf "julia-$1-linux-x86_64.tar.gz" --strip-components=1 julia + mkdir -p "$juliaInstallationPath" + tar -C "$juliaInstallationPath" -xzf "julia-$1-linux-x86_64.tar.gz" --strip-components=1 rm "julia-$1-linux-x86_64.tar.gz" # If this version of Julia is to be the default version, # symlink it into the path if [ "$2" = true ]; then - ln -s "/usr/local/julia$juliaMajorAndMinorVersion/bin/julia" /usr/bin/julia + ln -s "$juliaInstallationPath/bin/julia" /usr/bin/julia fi # Run tests to determine that the software installed as expected @@ -49,7 +50,7 @@ function InstallJulia () { fi # Verify output of julia --version - if [ ! "$(/usr/local/julia"$juliaMajorAndMinorVersion"/bin/julia --version)" = "julia version $1" ]; then + if [ ! "$($juliaInstallationPath/bin/julia --version)" = "julia version $1" ]; then echo "Julia was not installed correctly" exit 1 fi diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 9002370a7..7cedc0c8c 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -160,6 +160,7 @@ "{{template_dir}}/scripts/installers/1604/powershellcore.sh", "{{template_dir}}/scripts/installers/ruby.sh", "{{template_dir}}/scripts/installers/rust.sh", + "{{template_dir}}/scripts/installers/julia.sh", "{{template_dir}}/scripts/installers/sbt.sh", "{{template_dir}}/scripts/installers/selenium.sh", "{{template_dir}}/scripts/installers/sphinx.sh", diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 2d6125101..beec3c29f 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -163,6 +163,7 @@ "{{template_dir}}/scripts/installers/1804/powershellcore.sh", "{{template_dir}}/scripts/installers/ruby.sh", "{{template_dir}}/scripts/installers/rust.sh", + "{{template_dir}}/scripts/installers/julia.sh", "{{template_dir}}/scripts/installers/sbt.sh", "{{template_dir}}/scripts/installers/selenium.sh", "{{template_dir}}/scripts/installers/sphinx.sh", diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index fd0ff6108..cef6db8db 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -338,6 +338,12 @@ "{{ template_dir }}/scripts/Installers/Install-Rust.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-Julia.ps1" + ] + }, { "type": "powershell", "scripts":[ @@ -657,6 +663,12 @@ "{{ template_dir }}/scripts/Installers/Validate-Rust.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Validate-Julia.ps1" + ] + }, { "type": "powershell", "scripts":[ diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 5ded226e6..f143d07bd 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -307,6 +307,12 @@ "{{ template_dir }}/scripts/Installers/Install-Rust.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-Julia.ps1" + ] + }, { "type": "powershell", "scripts":[ @@ -626,6 +632,12 @@ "{{ template_dir }}/scripts/Installers/Validate-Rust.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Validate-Julia.ps1" + ] + }, { "type": "powershell", "scripts":[