Skip to content

Commit

Permalink
get packer on appveyor
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzmz committed Oct 18, 2017
1 parent daa72cf commit 2ad7aa7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ install:
- SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- python --version
- pip install -r %requirementsFile%
- tools\get-packer.ps1

build: off

Expand Down
11 changes: 11 additions & 0 deletions tools/get-packer.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$latestVersion = [string](((Invoke-RestMethod -Uri https://releases.hashicorp.com/packer/) -split "\n" | select-string -pattern "(\d+\.){2,3}\d+" | foreach {$_.matches} | select -expandproperty value) | %{[System.Version]$_} | sort | select -last 1)
$url = "https://releases.hashicorp.com/packer/$latestVersion/packer_$latestVersion_windows_amd64.zip"
$output = "$PSScriptRoot\packer.zip"

(New-Object System.Net.WebClient).DownloadFile($url, $output)
$extractPath = (get-item $PSScriptRoot).parent.FullName
$shell = new-object -com shell.application
$zip = $shell.NameSpace($output)
foreach($item in $zip.items()) {
$shell.Namespace("$extractPath").copyhere($item)
}

0 comments on commit 2ad7aa7

Please sign in to comment.