cake-build / cake

:cake: Cake (C# Make) is a cross platform build automation system.
https://cakebuild.net
MIT License
3.91k stars 729 forks source link

Add Jenkins CI build system support #693

Closed ghuntley closed 8 years ago

ghuntley commented 8 years ago

I /may/ be able to take lead on adding support for this but for now consider it up-for-grabs.

patriksvensson commented 8 years ago

@ghuntley Good suggestion. I use Cake in Travis to build some stuff and having access to Jenkins specific stuff would be very nice indeed. :+1:

rtyler commented 8 years ago

Apologies for air dropping into this ticket; I noticed this in my usual Googlings about. I'm assuming this ticket is about integrating Cake into Jenkins in some form or fashion.

Might I suggest some potential routes:

  1. Jenkins has tool auto-installers which you could implement in a Jenkins plugin to auto-install Cake. See this document on how to write them
  2. Implement a Build Step (CMake plugin ro the Gradle plugin might be good sources of techniques or information on how to accomplish this.
  3. Check out the Warnings plugin which already has support for aggregating build warnings from MSBuild and could be extended to include warnings generated out of Cake

If the goal is to drive Jenkins from Cake, that's a whole other can of worms :)

gep13 commented 8 years ago

@rtyler the intention for this Addin would really be to provide access to Jenkins functionality and properties, during the execution of a Cake Build.

We already have a number of Build Systems that Cake can talk to (http://cakebuild.net/dsl/build-system) and the hope would be to include Jenkins in that as well. Take for example the AppVeyor alias that ships with Cake (http://cakebuild.net/api/cake.common.build.appveyor/855a6067) this provides us access to things like IsRunningOnAppVeyor. We can use this setting in a build script to perhaps do different tasks, compared to when the build is running locally, or on another CI Server.

We also have extension methods like UpdateBuildVersion (http://cakebuild.net/api/cake.common.build.appveyor/855a6067/d14592e8), which does exactly what it says on the tin.

Now, most of these things are just wrappers around things that can be done in a different way. For example, reading an Environment Variable, or calling an available API. Wrapping those things up in the Cake Alias means that there is some consistency across the CI Systems that we offer, but also makes it much more easier to call into.

On the other side of the equation, we probably would also want to provide an easy on-boarding to running a Cake build through Jenkins. In the initial instance, this will likely just be a set of steps on how to do it, but in the future, we could see adding a Build Step specifically for Jenkins that does some of the "heavy-lifting" for you. We already have this for VSTS, and I for one would like to see it for all common CI Servers, but one thing at a time :smile:

rtyler commented 8 years ago

@gep13 Interesting, Jenkins provides a ton of environment variables that can be interrogated (plugins like the Gerrit Trigger plugin also add their own). As far as accessing or modifying the build as it's running in some form or fashion, this can typically be done via the Jenkins CLI or a plugin (of course).

Reading state: easy peasy, writing state, more challenging :)

gep13 commented 8 years ago

@rtyler thanks for all the information, and thanks for joining this discussion.

If either @ghuntley or someone else picks this up, I am sure we might be throwing some questions your way :+1:

RLittlesII commented 8 years ago

@gep13 I am looking at some of the Jenkins environment variables we have access to. Are you envisioning primarily read only access through the environment variables provided? Or are you thinking more a wrapper around the cli?

patriksvensson commented 8 years ago

@RLittlesII We're mostly looking at reading environment variables. There are some examples of other build system providers in Cake.Common.Build if you want to look more into this :smile:

RLittlesII commented 8 years ago

@patriksvensson Okay. I was just making sure before I go off and write a cli wrapper. I am looking at this today.

patriksvensson commented 8 years ago

@RLittlesII Ok, I'm marking this as taken then.

devlead commented 8 years ago

PR #715 proposed to fix this.

devlead commented 8 years ago

This is fixed by issue #715