|[Play 2.0] Example about how to test your Play2 applications with GitHub and Travis CI||gildegoma||4/14/12 9:42 AM|
Hi Play2 Developers !
Are you interested in free and powerful Continuous Integration for your applications based on Play2 Framework ? Yes, so just try Travis CI!
Here is an example about how you can test a Play2 application on Travis: https://github.com/gildegoma/travis-ci-ScalaOnPlay-sample
The current example runs the test with release 2.0 (other variant would consist in building all from source, Play20 included (see pending issue https://github.com/gildegoma/travis-ci-ScalaOnPlay-sample/issues/1)
Have fun! Feedbacks are welcome...
Some more notes (a bit out of post's scope, sorry I can't resist to drop some more ideas in the air ;-)
|Re: [Play 2.0] Example about how to test your Play2 applications with GitHub and Travis CI||Matthieu||4/23/12 1:36 PM|
Thanks your example.
I just had to do a 'chmod +x travis/setup' in order to avoid an error on Travis and then it worked like a charm.
|Re: [play-framework] Re: [Play 2.0] Example about how to test your Play2 applications with GitHub and Travis CI||Ivan Meredith||4/23/12 3:21 PM|
CloudBees have a service in early beta called BuildHive. It provides
a one-click integration with github to set up jobs from repos. You do
not need a CloudBees account to use it, just oauth with github.
For play2 it needs no extra files at all to build.
As I said above, it is in early beta - so we are looking for feedback
- Ivan, CloudBees Engineering
|Re: [play-framework] Re: [Play 2.0] Example about how to test your Play2 applications with GitHub and Travis CI||gildegoma||4/24/12 4:10 PM|
Hi again Ivan,
I noticed a few more things after sending my first response, hence these updates:
I found where you can configure:
Your play2 sample indeed builds well with 'sbt clean test', that install Play2 dependencies on the fly (https://buildhive.cloudbees.com/job/hadashi/job/play2-test-app/lastBuild/console):
[info] Resolving play#play_2.9.1;2.0 ... [info] Resolving play#templates_2.9.1;2.0 ...
But the build run #1 of my sample project failed a few steps before because commons-httpclient.jar was not possible to download (see https://buildhive.cloudbees.com/job/gildegoma/job/travis-ci-ScalaOnPlay-sample/lastBuild/console).
Can I force a new job to start? I cannot find a manual trigger...
Anyway, thanks again for the very interesting news... being impatient for next steps (more documentation, more stable service, more features :).
|Re: [play-framework] Re: [Play 2.0] Example about how to test your Play2 applications with GitHub and Travis CI||gildegoma||4/24/12 4:19 PM|
SORRY: I mixed myself and my 'second' answer has been posted while I actually failed to send first reponse... which I include now. Sorry, I think I better have to read Google Groups Help, but it's time to sleep now :-/
Thank you for the announcement. BuildHive/GitHub integration is smooth, quite similar as Travis/GitHub. Nice concurrence in perspective!
I actually tested 3 Projects (1 Play2 and 2 pure Scala) with following results:
Configuration auto-detection are nice features, but anyway it is a must to let user override/reconfigure default settings... Travis-CI is already quite mature, BuildHive can for sure take some good influences from it :-).
on https://buildhive.cloudbees.com/template/, I see that the list of build templates is already quite nice (sbt, maven, gradle, bundler/rake, ...). I would recommend you to setup a Play2 template, and then BuildHive wins one point in the race with Travis ;-)
I am looking forward a new discussion thread about BuildHive upcoming features !
|Re: [Play 2.0] Example about how to test your Play2 applications with GitHub and Travis CI||gildegoma||4/24/12 4:42 PM|
Thank you very much for the feedback! Yeah, missing 'x' permission is common pitfall when doing copy-paste of shell script content. Actually, I created this extra script 'travis/setup' in a Don't Repeat Yourself and clean code spirit, but it's not straightforward and maybe error-prone...
I thus created another variant where the complete Travis settings fit in main .travis.yml (no more extra shell script to integrate into project). Check it here: https://github.com/gildegoma/travis-ci-ScalaOnPlay-sample/blob/travis.yml-only/.travis.yml (not yet merged into master)
Let me know which variant you find better... My current feeling: +1 for this new variant (everything in .travis.yml).
Precision: Comments from Ivan Meredith show how Play projects can auto-download the Play dependency via Maven/Ivy/sbt. This is also quite nice way to do it, and it works fine either on BuildHive/Jenkins or Travis. My idea here was merely to save download time/traffic, with only a single file to download (play-2.0.zip release), which is also matches with Installation Guide of Play Framework (see http://www.playframework.org/documentation/2.0/Installing)
Le lundi 23 avril 2012 22:36:41 UTC+2, Matthieu a écrit :
|Ivan Meredith||4/24/12 4:56 PM|
Thanks for the feedback!
SBT detection sucks atm because I only made it work for play2. Ive
I will work on getting things going. However, your play2 app should be
> --> https://groups.google.com/d/msg/play-framework/-/d7_bLE5ZEkQJ.
|Ivan Meredith||4/24/12 5:13 PM|
Can you try making those jobs again? I've updated the template
On 25 April 2012 11:19, gildegoma <gilles...@gmail.com> wrote:
|Re: [Play 2.0] Example about how to test your Play2 applications with GitHub and Travis CI||Matthieu||4/24/12 11:04 PM|
I've just tested the variant with all the configuration in the .travis.yml file and it works well.
I prefer this variant because It's easier to understand and configure, and it also reduces the risk of error.
|gildegoma||4/25/12 3:41 AM|
I started a second job for Akka, and now 'sbt' detection indeed works fine, but the related command ('sbt test') is not valid in BuildHive environment. You should either:
- directly execute java -jar /opt/sbt/sbt-launch-0.11.0.jar clean test (as you do for your Play project)
- configure some symlink/script alias to "java -jar /opt/sbt/sbt-launch-0.11.0.jar" (example: https://github.com/mxcl/homebrew/blob/master/Library/Formula/sbt.rb#L10)
I also tried to re-run my Play2 app sample, but it still fails on the same step
My questions and remarks are now:
- It seems that the project workspace is permanently stored on BuildHive server-side between test runs. That's quite fine…
- Now I'm not able anymore to find the Menu 'configure' in the project context (where it was possible to select which branches must be built, which test script must be executed,…)
- I would recommend to start a new discussion thread dedicated to BuildHive itself (maybe on another group?). It's going to get messy here…
I found interesting documentation http://wiki.cloudbees.com/bin/view/DEV/BuildHive. Maybe we can further collaborate through IRC #cloudbees channel, as proposed in BuildHive help.
I'm looking forward to seeing these jobs succeed on BuildHive ;-)
|Re: [play-framework] [Play 2.0] Example about how to test your Play2 applications with GitHub and Travis CI||gildegoma||4/25/12 3:43 AM|
Thanks for positive feedback, I thus merged it to master :-)