fix azcopy and rust

This commit is contained in:
Aleksandr Chebotov
2020-09-14 21:47:31 +03:00
parent bcca2214d9
commit 6ed3828759
6 changed files with 71 additions and 66 deletions

View File

@@ -217,56 +217,6 @@ function Get-StackVersion {
return "Stack $stackVersion" return "Stack $stackVersion"
} }
function Get-RustVersion {
$rustVersion = $(rustc --version) | Take-OutputPart -Part 1
return "Rust $rustVersion"
}
function Get-BindgenVersion {
$bindgenVersion = $(bindgen --version) | Take-OutputPart -Part 1
return "Bindgen $bindgenVersion"
}
function Get-CargoVersion {
$cargoVersion = $(cargo --version) | Take-OutputPart -Part 1
return "Cargo $cargoVersion"
}
function Get-CargoAuditVersion {
$cargoAuditVersion = $(cargo audit --version) | Take-OutputPart -Part 1
return "Cargo audit $cargoAuditVersion"
}
function Get-CargoOutdatedVersion {
$cargoOutdatedVersion = $(cargo outdated --version) | Take-OutputPart -Part 1 -Delimiter "v"
return "Cargo outdated $cargoOutdatedVersion"
}
function Get-CargoClippyVersion {
$cargoClippyVersion = $(cargo-clippy --version) | Take-OutputPart -Part 1
return "Cargo clippy $cargoClippyVersion"
}
function Get-CbindgenVersion {
$cbindgenVersion = $(cbindgen --version) | Take-OutputPart -Part 1
return "Cbindgen $cbindgenVersion"
}
function Get-RustupVersion {
$rustupVersion = $(rustup --version) | Take-OutputPart -Part 1
return "Rustup $rustupVersion"
}
function Get-RustdocVersion {
$rustdocVersion = $(rustdoc --version) | Take-OutputPart -Part 1
return "Rustdoc $rustdocVersion"
}
function Get-RustfmtVersion {
$rustfmtVersion = $(rustfmt --version) | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "-"
return "Rustfmt $rustfmtVersion"
}
function Get-AzModuleVersions { function Get-AzModuleVersions {
$azModuleVersions = Get-ChildItem /usr/share | Where-Object { $_ -match "az_\d+" } | Foreach-Object { $azModuleVersions = Get-ChildItem /usr/share | Where-Object { $_ -match "az_\d+" } | Foreach-Object {
$_.Name.Split("_")[1] $_.Name.Split("_")[1]

View File

@@ -4,14 +4,15 @@ param (
) )
Import-Module MarkdownPS Import-Module MarkdownPS
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Android.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Browsers.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.CachedTools.psm1") -DisableNameChecking Import-Module (Join-Path $PSScriptRoot "SoftwareReport.CachedTools.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Common.psm1") -DisableNameChecking Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Common.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Helpers.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Tools.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Java.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Databases.psm1") -DisableNameChecking Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Databases.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Browsers.psm1") -DisableNameChecking Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Helpers.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Android.psm1") -DisableNameChecking Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Java.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Rust.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Tools.psm1") -DisableNameChecking
$markdown = "" $markdown = ""

View File

@@ -37,8 +37,7 @@ function Test-IsUbuntu20 {
return (lsb_release -rs) -eq "20.04" return (lsb_release -rs) -eq "20.04"
} }
function Get-ToolsetContent function Get-ToolsetContent {
{
$toolset = Join-Path $env:INSTALLER_SCRIPT_FOLDER "toolset.json" $toolset = Join-Path $env:INSTALLER_SCRIPT_FOLDER "toolset.json"
Get-Content $toolset -Raw | ConvertFrom-Json Get-Content $toolset -Raw | ConvertFrom-Json
} }

View File

@@ -0,0 +1,54 @@
function Initialize-RustEnvironment {
ln -sf "/usr/share/rust/.rustup" $HOME/.rustup
ln -sf "/usr/share/rust/.cargo" $HOME/.cargo
}
function Get-RustVersion {
Initialize-RustEnvironment
$rustVersion = $(rustc --version) | Take-OutputPart -Part 1
return "Rust $rustVersion"
}
function Get-BindgenVersion {
$bindgenVersion = $(bindgen --version) | Take-OutputPart -Part 1
return "Bindgen $bindgenVersion"
}
function Get-CargoVersion {
$cargoVersion = $(cargo --version) | Take-OutputPart -Part 1
return "Cargo $cargoVersion"
}
function Get-CargoAuditVersion {
$cargoAuditVersion = $(cargo audit --version) | Take-OutputPart -Part 1
return "Cargo audit $cargoAuditVersion"
}
function Get-CargoOutdatedVersion {
$cargoOutdatedVersion = $(cargo outdated --version) | Take-OutputPart -Part 1 -Delimiter "v"
return "Cargo outdated $cargoOutdatedVersion"
}
function Get-CargoClippyVersion {
$cargoClippyVersion = $(cargo-clippy --version) | Take-OutputPart -Part 1
return "Cargo clippy $cargoClippyVersion"
}
function Get-CbindgenVersion {
$cbindgenVersion = $(cbindgen --version) | Take-OutputPart -Part 1
return "Cbindgen $cbindgenVersion"
}
function Get-RustupVersion {
$rustupVersion = $(rustup --version) | Take-OutputPart -Part 1
return "Rustup $rustupVersion"
}
function Get-RustdocVersion {
$rustdocVersion = $(rustdoc --version) | Take-OutputPart -Part 1
return "Rustdoc $rustdocVersion"
}
function Get-RustfmtVersion {
$rustfmtVersion = $(rustfmt --version) | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "-"
return "Rustfmt $rustfmtVersion"
}

View File

@@ -4,7 +4,7 @@ function Get-7zipVersion {
} }
function Get-AnsibleVersion { function Get-AnsibleVersion {
$ansibleVersion = ansible --version | Select-Object -First 1 | Take-OutputPart -Part 1 $ansibleVersion = sudo ansible --version | Select-Object -First 1 | Take-OutputPart -Part 1
return "Ansible $ansibleVersion" return "Ansible $ansibleVersion"
} }
@@ -19,12 +19,12 @@ function Get-AzCopy10Version {
} }
function Get-BazelVersion { function Get-BazelVersion {
$bazelVersion = bazel --version | Select-String "bazel" | Take-OutputPart -Part 1 $bazelVersion = sudo bazel --version | Select-String "bazel" | Take-OutputPart -Part 1
return "Bazel $bazelVersion" return "Bazel $bazelVersion"
} }
function Get-BazeliskVersion { function Get-BazeliskVersion {
$bazeliskVersion = bazelisk version 2>&1 | Select-String "Bazelisk version:" | Take-OutputPart -Part 2 | Take-OutputPart -Part 0 -Delimiter "v" $bazeliskVersion = sudo bazelisk version 2>&1 | Select-String "Bazelisk version:" | Take-OutputPart -Part 2 | Take-OutputPart -Part 0 -Delimiter "v"
return "Bazelisk $bazeliskVersion" return "Bazelisk $bazeliskVersion"
} }
@@ -84,7 +84,7 @@ function Get-GitFTPVersion {
} }
function Get-GoogleCloudSDKVersion { function Get-GoogleCloudSDKVersion {
return "$(gcloud --version | Select-Object -First 1)" return "$(sudo gcloud --version | Select-Object -First 1)"
} }
function Get-HavegedVersion { function Get-HavegedVersion {
@@ -93,7 +93,7 @@ function Get-HavegedVersion {
} }
function Get-HerokuVersion { function Get-HerokuVersion {
$herokuVersion = heroku version | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/" $herokuVersion = sudo heroku version | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
return "Heroku $herokuVersion" return "Heroku $herokuVersion"
} }
@@ -146,7 +146,7 @@ function Get-NewmanVersion {
} }
function Get-NvmVersion { function Get-NvmVersion {
$nvmVersion = bash -c "source $HOME/.nvm/nvm.sh && nvm --version" $nvmVersion = bash -c "source /etc/skel/.nvm/nvm.sh && nvm --version"
return "nvm $nvmVersion" return "nvm $nvmVersion"
} }
@@ -193,12 +193,12 @@ function Get-JqVersion {
} }
function Get-AzureCliVersion { function Get-AzureCliVersion {
$azcliVersion = az -v | Select-String "azure-cli" | Take-OutputPart -Part -1 $azcliVersion = sudo az -v | Select-String "azure-cli" | Take-OutputPart -Part -1
return "Azure CLI (azure-cli) $azcliVersion" return "Azure CLI (azure-cli) $azcliVersion"
} }
function Get-AzureDevopsVersion { function Get-AzureDevopsVersion {
$azdevopsVersion = az -v | Select-String "azure-devops" | Take-OutputPart -Part -1 $azdevopsVersion = sudo az -v | Select-String "azure-devops" | Take-OutputPart -Part -1
return "Azure CLI (azure-devops) $azdevopsVersion" return "Azure CLI (azure-devops) $azdevopsVersion"
} }
@@ -230,7 +230,7 @@ function Get-GitHubCliVersion {
} }
function Get-NetlifyCliVersion { function Get-NetlifyCliVersion {
$netlifyVersion = netlify --version | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/" $netlifyVersion = sudo netlify --version | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
return "Netlify CLI $netlifyVersion" return "Netlify CLI $netlifyVersion"
} }

View File

@@ -17,6 +17,7 @@ rm azcopy.tar.gz
wget -O /tmp/azcopy.tar.gz https://aka.ms/downloadazcopy-v10-linux wget -O /tmp/azcopy.tar.gz https://aka.ms/downloadazcopy-v10-linux
tar zxvf /tmp/azcopy.tar.gz --strip-components=1 -C /tmp tar zxvf /tmp/azcopy.tar.gz --strip-components=1 -C /tmp
mv /tmp/azcopy /usr/local/bin/azcopy10 mv /tmp/azcopy /usr/local/bin/azcopy10
chmod +x /usr/local/bin/azcopy10
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"