0

Is it possible to use specific maven profiles when running tests/deploying a feature branch using jenkin and maven.

We have a team of developers using feature branches. We have our own maven profiles and associated uat deployment environments.

How can we set up jenkins to deploy, for example, branches :

feature/developer1-new-button
feature/developer1-replace-payment

using maven profile "developer1"

NimChimpsky
  • 46,453
  • 60
  • 198
  • 311
  • Can you elaborate? How do you deploy? Are you using plugins? A specific kind of job? – Behe Sep 10 '14 at 19:28
  • @Behe the deployment process doesn't matter ? I just need to use my maven goals (whatever they maybe) with a particular profile. This must be a common problem if you are using gitflow/feature branches ? – NimChimpsky Sep 10 '14 at 20:22
  • Why do you need having a different profile for a feature branch. They should always working with `mvn clean verify` or `mvn clean deploy` where is a difference needed? – khmarbaise Sep 11 '14 at 06:44
  • I don't have a different profile for each feature branch, I have a different profile for each developer, who works on multiple feature branches. @khmarbaise we use maven profiles to set deployment env. – NimChimpsky Sep 11 '14 at 06:53
  • @NimChimpsky: I thought it matters as you have mentioned it in your question. I do not understand how your deployment, branches and environments are related, that's why I asked. – Behe Sep 16 '14 at 15:37

1 Answers1

1

I havent used jenkins but I believe Bamboo is quite similar. In bamboo you can create several plans that can be triggered by changes on your repository and you can also specify for which branch name pattern you'll accept to start the build. for example I can make 3 similar plans that are triggered by changes on the repository and one for branches that start with feature/* other for branches that start with bugfix/* and other for just development. Since plans are different we can write tasks that execute goals for a certain profile. So you might have pushed the branch feature/deve... so you'll start the build for feature/* and there you might configure goal : clean deploy/test -P developer1

Betty Sanchez
  • 219
  • 3
  • 11