--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Just a question, what is the problem you are trying to solve... Or perhaps to put it another way, *why* would I want this?
--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/aOPAkUPQLws/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
On Fri, Oct 4, 2013 at 5:48 PM, Stephen Connolly <stephen.al...@gmail.com> wrote:
Just a question, what is the problem you are trying to solve... Or perhaps to put it another way, *why* would I want this?The Git flow pattern recommends a pattern for branching and branch naming that can be easily mapped to various types of builds (unit, integration, QA, deplyment, etc.).
Maven profiles are the usual way for customizing a Maven build but the standard profile activation mechanism is not that flexible. For example, I can't say that I want a profile activated if a specific Git branch/tag pattern is checked out.
Also, I would like to solve this in Maven instead of doing it with custom Jenkins scripts or plugins. That way I can get the same behavior when a build is done outside Jenkins. The main feature I need is the first one described earlier where a build depends on the checked out branch. In Jenkins, the Jenkins Git plugin checks out a detached head (not a branch) and keeps the branch information as an environment variable but even with this variable the default Maven activation doesn't allow wildcard or regex matching on the values so it is not that useful.
The idea is that when the Jenkins Git plugin builds all the changed branches from a repository (one by one in one Jenkins Job) the various build behaviors can be triggered by the current branch being built. To do that I am adding a new ProfileActivator [1] to activate profiles based on Git information. This is the general idea. I am sure there are other ways around this but I would like to make my Maven builds aware of their Git context. Also, this is a good excerise for me to learn all the relevant APIs but I also think that it might be useful for other Jenkins/Maven/Git users. Hope this helps clarify why I am doing this.
[1] http://maven.apache.org/ref/3.1.0/maven-model-builder/apidocs/org/apache/maven/model/profile/activation/ProfileActivator.html