Skip to content
This repository has been archived by the owner on Jul 16, 2019. It is now read-only.

Commit

Permalink
Updated Get-TraefikBinary script to require release URL
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcollinge committed Mar 28, 2018
1 parent feec7dc commit e817e99
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Docs/Deployments/VisualStudio.MD
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ First things first, make sure you have a Windows Service Fabric cluster up and r

2. Download the Træfik binary into the solution by running the following PowerShell script.

`./$REPO_ROOT/Traefik/Scripts/Get-TraefikBinary.ps1`
`./$REPO_ROOT/Traefik/Scripts/Get-TraefikBinary.ps1 -url $TRAEFIK_RELEASE`

> This script will use a specific build from this repository's release list. To override the build's download URL, provide the `-url` parameter to the script.
> This script requires a `url` to be provided to the Træfik release you wish to download and install. A list of the available release are here: https://github.com/containous/traefik/releases.
3. Open the `Traefik.sln` file in Visual Studio

Expand Down
24 changes: 16 additions & 8 deletions Traefik/Scripts/Get-TraefikBinary.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,33 @@ param(
[string]$urlWatchdog="https://github.com/lawrencegripper/traefik-appinsights-watchdog/releases/download/v0.0.3/windows_traefik-appinsights-watchdog.exe"
)

if (!($url))
while (!($url))
{
Write-Host "Review current Traefik releases: https://github.com/containous/traefik/releases"
$url = Read-Host "Please provide the full URL of the Traefik release you wish to download"
Write-Host "Review current Traefik releases:" -foregroundcolor Green
Write-Host "https://github.com/containous/traefik/releases"
Write-Host "Please provide the full URL of the Traefik release you wish to download: " -foregroundcolor Green -NoNewline
$url = Read-Host
}

#Github and other sites now require tls1.2 without this line the script will fail with an SSL error.
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"

Write-Host "Downloading Traefik Binary from $url" -foregroundcolor Green
Write-Host "to use a specific binary use -url arg" -foregroundcolor Green
Write-Host "Downloading Traefik Binary from: " -foregroundcolor Green
Write-Host $url
Write-Host "Downloading Traefik Watchdog Binary from:" -foregroundcolor Green
Write-Host $urlWatchdog

$outfile = $PSScriptRoot+"/../ApplicationPackageRoot/TraefikPkg/Code/traefik.exe"
$outfileWatchdog = $PSScriptRoot+"/../ApplicationPackageRoot/Watchdog/Code/traefik-appinsights-watchdog.exe"
$traefikPath = "/../ApplicationPackageRoot/TraefikPkg/Code/traefik.exe"
$treafikWatchdogPath = "/../ApplicationPackageRoot/Watchdog/Code/traefik-appinsights-watchdog.exe"
$outfile = Join-Path $PSScriptRoot $traefikPath
$outfileWatchdog = Join-Path $PSScriptRoot $treafikWatchdogPath

Invoke-WebRequest -Uri $url -OutFile $outfile -UseBasicParsing
Invoke-WebRequest -Uri $urlWatchdog -OutFile $outfileWatchdog -UseBasicParsing

Write-Host "Download complete" -foregroundcolor Green
Write-Host "Download complete, files:" -foregroundcolor Green
Write-Host $outfile
Write-Host $outfileWatchdog

Write-Host "Traefik version downloaded:" -foregroundcolor Green

Expand Down

0 comments on commit e817e99

Please sign in to comment.