-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpsakefile.ps1
55 lines (41 loc) · 948 Bytes
/
psakefile.ps1
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
Task default -depends Restore, Build
Task Deploy {
}
Task CI -depends Install-deps, Restore, Build, Test, Benchmark, Report
Task CD -depends CD-Build, Deploy
Task CD-Build -depends Install-deps, Restore, Build
Task Restore {
}
Task Build {
if (-not (Test-Path -Path "dist")) {
New-Item -Path "dist" -ItemType Directory
}
Set-Location src
$env:CGO_ENABLED = 0
Exec { go build -v -o ../dist/listat.exe }
Set-Location ..
}
Task Install-deps {
}
Task Test {
Set-Location src
go test -v .
Set-Location ..
}
Task Benchmark {
}
Task Report {
}
Task Run -depends Build {
Set-Location ./dist
$env:LISTAT_DBORIGIN = "root:123456@(localhost:3306)"
$env:LISTAT_DBNAME = "listat_db"
$env:LISTAT_PORT = "4500"
Exec { ./listat.exe }
}
Task Docker {
Exec { docker-compose up -d db }
Start-Sleep -Seconds 15
Exec { docker-compose up -d }
Start-Sleep -Seconds 5
}