Dynamically building multiple projects in Jenkins -


i'd use jenkins dynamically search *.sln files , trigger build each one.

i have git repository following structure:

\project1\project1.sln \project2\project2.sln \project3\project3.sln .. 

my current solution have 2 projects.

parent project:

  1. add build step: "trigger/call builds on other projects"
  2. add parameterfactory: "for every matching file, invoke 1 build"
  3. search .sln files , trigger build each matching file, filename set to: solutionfile

child project:

  1. use environment variable "solutionfile" create relative path solution file.

for example: project1.sln becomes project1\project1.sln

  1. build solution

does have suggestions better / more robust solution?

this best solution i've been able come far.

there 2 projects: top level responsible identifying solution files, sub project builds solution file.

top level project:

  1. fetches repository
  2. executes windows powershell script search .sln files , creates properties file each one:

    $solutions = get-childitem ./ -recurse -include *.sln   foreach ($solution in $solutions) {     write-host "identified solution build: $($solution.name)"     resolve-path -relative $solution | foreach { "solutionfile=$_" -replace  '\\', '\\' | out-file "$($solution.name).properties" -encoding ascii}  } 

    note: had use encoding type ascii, or parameters contain characters.

  3. build step: "trigger/call builds on other projects" parameter/factories of "for every property file, invoke 1 build"

file pattern: *.properties

sub project:

  1. setup parameter: solutionfile, fed in properties file
  2. fetches repository
  3. builds solution file

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -