ikeike443 / HudsonPluginForPlay

Jenkins plugin for Play! framework. This is trunk of jenkins-ci/play-plugin.
http://wiki.jenkins-ci.org/display/JENKINS/play-plugin
33 stars 28 forks source link

Configurable path to application #12

Closed maichler closed 13 years ago

maichler commented 13 years ago

It would be really nice to be able to configure the path to the play application on a per job basis. A concrete use case is when you have split the application in one main application and several application modules, e.g.

main/ module-1 module-2 ...

The plugin currently expects to have the play application directly under the workspace path, so the example above will fail as the application sits in main/.

ikeike443 commented 13 years ago

What do you mean "module-1" or 2? Please explain more detail.

To configure play path per job will be available at 0.0.5 from jenkins update center. I've released it just now.

Thank you.

maichler commented 13 years ago

Excuse my late response, I simply overlooked it. Regarding those module names please have a look at the documentation about "How to load a module from an application" at http://www.playframework.org/documentation/1.1.1/modules#anameloadingHowtoloadamodulefromanapplicationa

I have a project layout like described in this documentation and it looks like this:

workspace/
  sis/           # main application
  sis-dhtml/     # module-1
  sis-ldap/      # module-2
  ...

Now the problem is that the Jenkins plugin expects the Play! application to sit directly underneath the workspace directory and not - as it is here - in a subdirectory. So, what I want to do is to specify a path (relative to the workspace directory) where the Jenkins plugin should execute the play commands (in this case "sis")

Hope this clarifies things ?

jeffcrilly commented 13 years ago

I just ran into the same issue.

Under my git workspace top-level are a number of projects unrelated to play.

One of the projects is "web".

Within "web" we have the play app and modules. When I use auto-test it runs "play" at the top level, and hence does not find my play project.

For example, here is my directory structure for the build...

$ pwd /var/lib/jenkins/jobs/web-test/workspace

$ ls web ./ ../ play/

$ ls web/play ./ ../ app/ conf/ logs/ modules/ public/ test/ test-result/ tmp/

From the command line in workspace, if i run ... " play auto-test web/play " then it all works fine. But I see no way to 1) tell the play-plugin to use build/test " web/play " or 2) to tell jenkins to change-dir that directory before running the play-plugin.

thx

-jeff

jeffcrilly commented 13 years ago

I sorta fixed this a little bit by modifying the code from the "jenkinsci / play-plugin". Essentially I added another "advanced" parameter that contains the "application module" to auto-test. The code simply appends this "app_path" string, if set. If the app_path string is not set, then the code behaves as-is. Am not sure if this is the ideal solution, but its worth a shot. (I've got other dependencies to work out with jenkins/play in general, so I've not been able to get this to 100% verified yet.)

ikeike443 commented 13 years ago

Thanks, I'll check it later.

jeffcrilly commented 13 years ago

Additionally, it appears the "Play! auto-test reports" plugin will also need to use the configurable path when testing for success in the test-result directory.

ikeike443 commented 13 years ago

Thank you, and sorry for late response.

lu199195, Thank you. I got it. It is clear to me.

jeffcrilly, It sounds cool, maybe nice idea. Would you send me a pull request?

ikeike443 commented 13 years ago

Thanks. All done. https://github.com/ikeike443/HudsonPluginForPlay/pull/25

Thank you all and yjaigu.