mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
refactoring scripts so the build server can run each in-step
This commit is contained in:
13
build.cmd
13
build.cmd
@@ -12,6 +12,19 @@ IF NOT [%1]==[] (set TARGET="%1")
|
||||
SET BUILDMODE="Release"
|
||||
IF NOT [%2]==[] (set BUILDMODE="%2")
|
||||
|
||||
:: because we want to run specific steps inline on qed
|
||||
:: we need to break the dependency chain
|
||||
:: this ensures we do a build before running any tests
|
||||
|
||||
if TARGET=="Default" (SET RunBuild=1)
|
||||
if TARGET=="RunUnitTests" (SET RunBuild=1)
|
||||
if TARGET=="RunIntegrationTests" (SET RunBuild=1)
|
||||
if TARGET=="CreatePackages" (SET RunBuild=1)
|
||||
|
||||
if "%RunBuild%"=="" (
|
||||
"tools\FAKE.Core\tools\Fake.exe" "build.fsx" "target=BuildApp" "buildMode=%BUILDMODE%"
|
||||
)
|
||||
|
||||
"tools\FAKE.Core\tools\Fake.exe" "build.fsx" "target=%TARGET%" "buildMode=%BUILDMODE%"
|
||||
|
||||
rem Bail if we're running a TeamCity build.
|
||||
|
||||
17
build.fsx
17
build.fsx
@@ -131,14 +131,21 @@ Target "CreateOctokitReactivePackage" (fun _ ->
|
||||
|
||||
Target "Default" DoNothing
|
||||
|
||||
Target "CreatePackages" DoNothing
|
||||
|
||||
"Clean"
|
||||
==> "AssemblyInfo"
|
||||
==> "CheckProjects"
|
||||
==> "BuildApp"
|
||||
==> "UnitTests"
|
||||
==> "IntegrationTests"
|
||||
==> "CreateOctokitPackage"
|
||||
==> "CreateOctokitReactivePackage"
|
||||
==> "BuildApp"
|
||||
|
||||
"UnitTests"
|
||||
==> "Default"
|
||||
|
||||
"IntegrationTests"
|
||||
==> "Default"
|
||||
|
||||
"CreateOctokitPackage"
|
||||
"CreateOctokitReactivePackage"
|
||||
==> "CreatePackages"
|
||||
|
||||
RunTargetOrDefault "Default"
|
||||
@@ -35,6 +35,17 @@ function Die-WithOutput($exitCode, $output) {
|
||||
exit $exitCode
|
||||
}
|
||||
|
||||
function Dump-Error($output) {
|
||||
$exitCode = $LastExitCode
|
||||
|
||||
$errors = $output | Select-String ": error"
|
||||
if ($errors) {
|
||||
$output = "Likely errors:", $errors, "", "Full output:", $output
|
||||
}
|
||||
|
||||
Die-WithOutput $exitCode $output
|
||||
}
|
||||
|
||||
function Run-Command([scriptblock]$Command, [switch]$Fatal, [switch]$Quiet) {
|
||||
$output = ""
|
||||
if ($Quiet) {
|
||||
@@ -81,16 +92,34 @@ else {
|
||||
|
||||
Write-Output "Building Octokit..."
|
||||
Write-Output ""
|
||||
$output = .\tools\FAKE.Core\tools\Fake.exe "build.fsx" "target=Default" "buildMode=Release"
|
||||
$output = & .\tools\FAKE.Core\tools\Fake.exe "build.fsx" "target=BuildApp" "buildMode=Release" 2>&1
|
||||
if ($LastExitCode -ne 0) {
|
||||
$exitCode = $LastExitCode
|
||||
Dump-Error($output)
|
||||
}
|
||||
|
||||
$errors = $output | Select-String ": error"
|
||||
if ($errors) {
|
||||
$output = "Likely errors:", $errors, "", "Full output:", $output
|
||||
}
|
||||
Write-Output "Running unit tests..."
|
||||
Write-Output ""
|
||||
$output = & .\tools\FAKE.Core\tools\Fake.exe "build.fsx" "target=UnitTests" "buildMode=Release" 2>&1
|
||||
if ($LastExitCode -ne 0) {
|
||||
Dump-Error($output)
|
||||
}
|
||||
|
||||
Die-WithOutput $exitCode $output
|
||||
Write-Output "Running integration tests..."
|
||||
Write-Output ""
|
||||
$output = & .\tools\FAKE.Core\tools\Fake.exe "build.fsx" "target=IntegrationTests" "buildMode=Release" 2>&1
|
||||
if ($LastExitCode -ne 0) {
|
||||
Dump-Error($output)
|
||||
}
|
||||
|
||||
Write-Output "Creating NuGet packages..."
|
||||
Write-Output ""
|
||||
$output = & .\tools\FAKE.Core\tools\Fake.exe "build.fsx" "target=CreateOctokitPackage" "buildMode=Release" 2>&1
|
||||
if ($LastExitCode -ne 0) {
|
||||
Dump-Error($output)
|
||||
}
|
||||
$output = & .\tools\FAKE.Core\tools\Fake.exe "build.fsx" "target=CreateOctokitReactivePackage" "buildMode=Release" 2>&1
|
||||
if ($LastExitCode -ne 0) {
|
||||
Dump-Error($output)
|
||||
}
|
||||
|
||||
$exitCode = 0
|
||||
|
||||
Reference in New Issue
Block a user