forked from PlayFab/consuldotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
65 lines (57 loc) · 2 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
version: 0.5.2.{build}-{branch}
configuration: Release
platform: Any CPU
clone_depth: 1
clone_folder: C:\consul
init:
- if "%APPVEYOR_REPO_TAG%" == "true" set APPVEYOR_BUILD_VERSION=%APPVEYOR_REPO_TAG_NAME%
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: $(APPVEYOR_BUILD_VERSION)
assembly_file_version: $(APPVEYOR_BUILD_VERSION)
assembly_informational_version: $(APPVEYOR_BUILD_VERSION)
environment:
CONSUL_VERSION: 0.5.2
install:
- ps: >-
choco install 7zip.commandline
$consul_zip = "$($env:CONSUL_VERSION)_windows_386.zip"
if (!(Test-Path "C:\consul_install")) {mkdir C:\consul_install}
if (!(Test-Path "C:\consul_install\$consul_zip")) {(new-object net.webclient).DownloadFile("https://dl.bintray.com/mitchellh/consul/$consul_zip", "C:\consul_install\$consul_zip")}
7z x -y C:\consul_install\$consul_zip -oC:\consul\Consul.Test
cache:
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
- C:\consul_install
nuget:
disable_publish_on_pr: true
before_build:
- nuget restore
build:
publish_nuget: true
publish_nuget_symbols: true
verbosity: minimal
before_test:
- ps: >-
$consulJob = Start-Job {C:\consul\Consul.Test\consul.exe agent -config-file C:\consul\Consul.Test\test_config.json -advertise 127.0.0.1 -bind 127.0.0.1}
$running = $false
do {
Receive-Job -Job $consulJob
if ($running -and $consulJob.State -ne "Running") {break}
if ($consulJob.State -eq "Running") {
$running = $true
try {$result = convertfrom-json (invoke-webrequest -UseBasicParsing -TimeoutSec 1 -Uri http://localhost:8500/v1/status/leader).Content; sleep 1} catch {write-output "Waiting for Consul to come up..."}
}
} until (![string]::IsNullOrEmpty($result))
Receive-Job $consulJob
after_test:
- ps: >-
Get-Job | Stop-Job
Get-Job | Receive-Job
deploy:
- provider: NuGet
api_key:
secure: dv44i0f5BvM3LZRUU/B0emsLEIbO9geASxNnMd074SXPligvsk81P8nzY/3m2z/z
on:
APPVEYOR_REPO_TAG: true