Skip to content

Commit

Permalink
fix appveyor, attempt 5
Browse files Browse the repository at this point in the history
  • Loading branch information
rustatian committed Jun 14, 2019
1 parent 9b6c758 commit f249eb9
Showing 1 changed file with 13 additions and 34 deletions.
47 changes: 13 additions & 34 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,32 @@ platform: x64
clone_folder: c:\gopath\src\github.com\openzipkin\zipkin-go

environment:
erlang_download_url: "http://erlang.org/download/otp_win64_22.0.exe"
erlang_exe_path: "C:\\Users\\appveyor\\erlang_22.0.exe"
erlang_home_dir: "C:\\Users\\appveyor\\erlang"
erlang_erts_version: "erts-10.4"

rabbitmq_version: 3.7.4
rabbitmq_installer_download_url: "https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.15/rabbitmq-server-3.7.15.exe"
rabbitmq_installer_path: "C:\\Users\\appveyor\\rabbitmq-server-3.7.15.exe"

GOPATH: c:\gopath
GO111MODULE: on
GOFLAGS: -mod=readonly

install:
- ps: $webclient=New-Object System.Net.WebClient

- ECHO Downloading Erlang...
- ps: if (-Not (Test-Path "$env:erlang_exe_path")) { $webclient.DownloadFile("$env:erlang_download_url", "$env:erlang_exe_path") } else { Write-Host "Found" $env:erlang_exe_path "in cache." }
- Write-Host "Installing RabbitMQ..." -ForegroundColor Cyan

- ECHO Installing Erlang...
- start /B /WAIT %erlang_exe_path% /S /D=%erlang_home_dir%
- set ERLANG_HOME=%erlang_home_dir%
- Write-Host "Downloading..."
- $exePath = "$($env:USERPROFILE)\rabbitmq-server-3.7.15.exe"
- (New-Object Net.WebClient).DownloadFile('https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.15/rabbitmq-server-3.7.15.exe', $exePath)

- ECHO Downloading RabbitMQ...
- ps: if (-Not (Test-Path "$env:rabbitmq_installer_path")) { $webclient.DownloadFile("$env:rabbitmq_installer_download_url", "$env:rabbitmq_installer_path") } else { Write-Host "Found" $env:rabbitmq_installer_path "in cache." }
- Write-Host "Installing..."
- cmd /c start /wait $exePath /S

- ECHO Creating directory %AppData%\RabbitMQ...
- ps: New-Item -ItemType Directory -ErrorAction Continue -Path "$env:AppData/RabbitMQ"
- $rabbitPath = 'C:\Program Files (x86)\RabbitMQ Server\rabbitmq-server-3.7.15'

- ECHO Creating RabbitMQ configuration file in %AppData%\RabbitMQ...
- ps: Get-Content C:/Projects/pika/testdata/rabbitmq.conf.in | %{ $_ -replace 'PIKA_DIR', 'C:/projects/pika' } | Set-Content -Path "$env:AppData/RabbitMQ/rabbitmq.conf"
- ps: Get-Content "$env:AppData/RabbitMQ/rabbitmq.conf"
- Write-Host "Installing service..."
- Start-Process -Wait "$rabbitPath\sbin\rabbitmq-service.bat" "install"

- ECHO Creating Erlang cookie files...
- ps: '[System.IO.File]::WriteAllText("C:\Users\appveyor\.erlang.cookie", "PIKAISTHEBEST", [System.Text.Encoding]::ASCII)'
- ps: '[System.IO.File]::WriteAllText("C:\Windows\System32\config\systemprofile\.erlang.cookie", "PIKAISTHEBEST", [System.Text.Encoding]::ASCII)'
- Write-Host "Starting service..."
- Start-Process -Wait "$rabbitPath\sbin\rabbitmq-service.bat" "start"

- ECHO Installing and starting RabbitMQ with default config...
- start /B /WAIT %rabbitmq_installer_path% /S
- ps: (Get-Service -Name RabbitMQ).Status
- Get-Service "RabbitMQ"

- ECHO Waiting for epmd to report that RabbitMQ has started...
- ps: 'C:\projects\pika\testdata\wait-epmd.ps1'
- ps: 'C:\projects\pika\testdata\wait-rabbitmq.ps1'
- Write-Host "RabbitMQ installed and started" -ForegroundColor Green

- ECHO Getting RabbitMQ status...
- cmd /c "C:\Program Files\RabbitMQ Server\rabbitmq_server-%rabbitmq_version%\sbin\rabbitmqctl.bat" status
- echo %PATH%
- echo %GOPATH%
- set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
Expand Down

0 comments on commit f249eb9

Please sign in to comment.