mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
Use Latest instead of detecting latest
We now use symlinks that always point to latest
This commit is contained in:
parent
f6d5027ea7
commit
15968cbdf6
1 changed files with 2 additions and 19 deletions
|
@ -211,27 +211,10 @@ Else {
|
|||
}
|
||||
|
||||
#===============================================================================
|
||||
# Figure out the latest version if no version is passed
|
||||
# Use version "Latest" if no version is passed
|
||||
#===============================================================================
|
||||
# If version isn't supplied, use latest.
|
||||
If (!$version) {
|
||||
# Find latest version of Salt Minion
|
||||
$repo = Invoke-Restmethod "$repourl"
|
||||
$regex = "<\s*a\s*[^>]*?href\s*=\s*[`"']*([^`"'>]+)[^>]*?>"
|
||||
$returnMatches = New-Object System.Collections.ArrayList
|
||||
$resultingMatches = [Regex]::Matches($repo, $regex, "IgnoreCase")
|
||||
foreach($match in $resultingMatches) {
|
||||
$cleanedMatch = $match.Groups[1].Value.Trim()
|
||||
[void] $returnMatches.Add($cleanedMatch)
|
||||
}
|
||||
If ($arch -eq 'x86') {
|
||||
$returnMatches = $returnMatches | Where {$_ -like "Salt-Minion*x86-Setup.exe"}
|
||||
}
|
||||
Else {
|
||||
$returnMatches = $returnMatches | Where {$_ -like "Salt-Minion*AMD64-Setup.exe"}
|
||||
}
|
||||
|
||||
$version = $($returnMatches[$returnMatches.Count -1]).Split(("n-","-A","-x","-P"),([System.StringSplitOptions]::RemoveEmptyEntries))[1]
|
||||
$version = "Latest"
|
||||
}
|
||||
|
||||
$versionSection = $version
|
||||
|
|
Loading…
Add table
Reference in a new issue