Best way to split FAKE script build for Teamcity

Without Teamcity, I would put everything in one big .fsx script and just “shoot and forget” it. It would be nice to have one script to build, doing all the work.

But when we put the .fsx script in Teamcity, everything changed. Teamcity has a nice build log and functions as steps, but all the logic in the same script and build step results in a HUGE build log.

We have the assembly and tests in one .fsx script, and I was going to place the distribution building in it. But now I do not think this is a great idea. Perhaps it would be better to split this build script into several build scripts and run them at several build stages?

But with several scenarios, it’s not very convenient to run the assembly locally, without Teamcity, if we need to. Or we may have several small build scripts for each task, and one of them will build a script for local build, invoking all of these small scripts.

What is the best solution for this?

+4
source share
2 answers

This is my personal opinion, and not the “best solution”: I will not use several assembly steps or build pipelines in Teamcity, as this will lead to blocking the supplier.

However, if you still want to use assembly pipelines, use one assembly file and make heavy use of FAKE assembly targets and conditional dependencies.

if isLocalBuild then
  A 
  ==> B
  ==> C

, , . TeamCity , ( FAKE.exe target = A).

+2

, , - @forki23. .fsx, -, , :

Clean ==> Build
BuildTests ==> RunTests
SignExes ==> PackDistr

"", ..

Step1: fake build.fsx target=Build
Step2: fake build.fsx target=RunTests
Step3: fale build.fsx target=PackDistr

.bat , .bat. , isLocalBuild, @forki23. .fsx script !

+2

Source: https://habr.com/ru/post/1545398/


All Articles