forked from gomods/athens
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
59 lines (52 loc) · 2.34 KB
/
azure-pipelines.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
# Go
# Build your Go project.
# Add steps that test, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/go
pool:
vmImage: 'vs2017-win2016'
variables:
GOBIN: '$(GOPATH)\bin' # Go binaries path
GOPATH: '$(system.defaultWorkingDirectory)\gopath' # Go workspace path
GO111MODULE: 'on'
modulePath: '$(GOPATH)\src\github.com\$(build.repository.name)' # Path to the module's code
steps:
- powershell: |
mkdir "$env:GOBIN" | out-null
mkdir "$env:GOPATH\pkg" | out-null
mkdir "$env:modulePath" | out-null
robocopy "$env:system_defaultWorkingDirectory\" "$env:modulePath\" /E /Z /ZB /R:5 /W:5 /TBD /NP /V /XD "$env:GOPATH"
exit ($LastExitCode -band 24)
displayName: 'set up the Go workspace'
- powershell: |
$downloadURL = "https://dl.minio.io/server/minio/release/windows-amd64/minio.exe"
Write-Host "download minio from $downloadURL - start"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri $downloadURL -OutFile "minio.exe"
Write-Host "download minio - end"
Start-Process -NoNewWindow minio.exe 'server --address ":9001" .'
env:
MINIO_ACCESS_KEY: "minio"
MINIO_SECRET_KEY: "minio123"
displayName: 'start minio'
- powershell: |
$downloadURL = "https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.4-signed.msi"
Write-Host "download mongo from $downloadURL - start"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri $downloadURL -OutFile "mongo.msi"
Write-Host "download mongo - end"
Write-Host "install mongo - start"
Start-Process msiexec -Wait -ArgumentList @('/i', 'mongo.msi', '/quiet', '/qn', 'INSTALLLOCATION=C:\mongodb', 'ADDLOCAL=all')
$env:PATH = 'C:\mongodb\bin;' + $env:PATH
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
mkdir C:\data\db | out-null
mkdir C:\data\configdb | out-null
Write-Host "install mongo - end"
Start-Process -NoNewWindow mongod.exe '--bind_ip_all --dbpath="C:\data\db"'
displayName: 'install & start mongo'
- powershell: |
go test -mod=vendor -race ./...
env:
ATHENS_MINIO_ENDPOINT: "127.0.0.1:9001"
ATHENS_MONGO_STORAGE_URL: "127.0.0.1:27017"
workingDirectory: '$(modulePath)'
displayName: 'run tests'