I'm trying to setup bamboo to work with a Play web application but it is not working. I'm using the script task to run the play script and it is complaining that it can't find a main class. However, if I open a shell and run play from the same directory it works fine. There is something about the environment which bamboo is running the script than the environment which the shell is using. Does anyone have any experience with Play 1.2 projects and Bamboo? (I'm not finding much help online).
You can reproduce by:
(note: I'm using Ubuntu 13 and OpenJDK 1.7)
1. Download the play 1.2 framework - I'm using http://downloads.typesafe.com/play/1.2.5.3/play-1.2.5.3.zip
2. unzip it and add the directory to your path (so that the 'play' command is on the path).
3. install bamboo with the express install and create a new project/plan.
4. create a play app in a source repo. For example, see https://jhatfield@bitbucket.org/jhatfield/bambootest.git
5. create a bamboo task to build and run the tests for the app. Use the script task and enter:
play auto-test
6. When I run the build it outputs:
simple23-Oct-2013 15:44:38Build bambooTest - bambooTest - Default Job #4 (BAM-BAM-JOB1-4) started building on agent Default Agent
simple23-Oct-2013 15:44:38Build working directory is /home/john/bamboo_home/xml-data/build-dir/BAM-BAM-JOB1
simple23-Oct-2013 15:44:38Executing build bambooTest - bambooTest - Default Job #4 (BAM-BAM-JOB1-4)
simple23-Oct-2013 15:44:38Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
simple23-Oct-2013 15:44:38Updating source code to revision: eaa676f578ac0c50aa381e9579b2b88751f6cd6c
simple23-Oct-2013 15:44:38Fetching 'refs/heads/master' from 'https://bitbucket.org/jhatfield/bambootest'.
simple23-Oct-2013 15:44:39Checking out revision eaa676f578ac0c50aa381e9579b2b88751f6cd6c.
simple23-Oct-2013 15:44:39Already on 'master'
simple23-Oct-2013 15:44:39Updated source code to revision: eaa676f578ac0c50aa381e9579b2b88751f6cd6c
simple23-Oct-2013 15:44:39Finished task 'Checkout Default Repository'
simple23-Oct-2013 15:44:39Running pre-build action: Clover Grails PreBuild Action
simple23-Oct-2013 15:44:39Running pre-build action: VCS Version Collector
simple23-Oct-2013 15:44:39Starting task 'play auto-test' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
command23-Oct-2013 15:44:39Beginning to execute external process for build 'bambooTest - bambooTest - Default Job #4 (BAM-BAM-JOB1-4)'\n ... running command line: \n/bin/sh /home/john/bamboo/atlassian-bamboo-5.2/temp/BAM-BAM-JOB1-4-ScriptBuildTask-5809565771198221764.sh\n ... in: /home/john/bamboo_home/xml-data/build-dir/BAM-BAM-JOB1\n
error23-Oct-2013 15:44:40Error: Could not find or load main class
build23-Oct-2013 15:44:40~ _ _
build23-Oct-2013 15:44:40~ _ __ | | __ _ _ _| |
build23-Oct-2013 15:44:40~ | '_ \| |/ _' | || |_|
build23-Oct-2013 15:44:40~ | __/|_|\____|\__ (_)
build23-Oct-2013 15:44:40~ |_| |__/
build23-Oct-2013 15:44:40~
build23-Oct-2013 15:44:40~ play! 1.2.5.3, http://www.playframework.org
build23-Oct-2013 15:44:40~ framework ID is test
build23-Oct-2013 15:44:40~
build23-Oct-2013 15:44:40~ Running in test mode
build23-Oct-2013 15:44:40~ Ctrl+C to stop
build23-Oct-2013 15:44:40~
build23-Oct-2013 15:44:40~ Deleting /home/john/bamboo_home/xml-data/build-dir/BAM-BAM-JOB1/tmp
build23-Oct-2013 15:44:40~
build23-Oct-2013 15:44:40~
build23-Oct-2013 15:44:40~ Oops, application has not started?
build23-Oct-2013 15:44:40~
simple23-Oct-2013 15:44:40Failing task since return code of [/bin/sh /home/john/bamboo/atlassian-bamboo-5.2/temp/BAM-BAM-JOB1-4-ScriptBuildTask-5809565771198221764.sh] was 255 while expected 0
simple23-Oct-2013 15:44:40Finished task 'play auto-test'
simple23-Oct-2013 15:44:40Running post build plugin 'NCover Results Collector'
simple23-Oct-2013 15:44:40Running post build plugin 'Clover Results Collector'
simple23-Oct-2013 15:44:40Running post build plugin 'Artifact Copier'
simple23-Oct-2013 15:44:40Finalising the build...
simple23-Oct-2013 15:44:40Stopping timer.
simple23-Oct-2013 15:44:40Build BAM-BAM-JOB1-4 completed.
simple23-Oct-2013 15:44:40Running on server: post build plugin 'NCover Results Collector'
simple23-Oct-2013 15:44:40Running on server: post build plugin 'Clover Delta Calculator'
simple23-Oct-2013 15:44:40Running on server: post build plugin 'Build Hanging Detection Configuration'
simple23-Oct-2013 15:44:40Running on server: post build plugin 'Maven Dependencies Postprocessor'
simple23-Oct-2013 15:44:40All post build plugins have finished
simple23-Oct-2013 15:44:40Generating build results summary...
Note that it runs fine from a shell:
john@ubuntu:~$ cd /home/john/bamboo_home/xml-data/build-dir/BAM-BAM-JOB1
john@ubuntu:~/bamboo_home/xml-data/build-dir/BAM-BAM-JOB1$ play auto-test
~ _ _
~ _ __ | | __ _ _ _| |
~ | '_ \| |/ _' | || |_|
~ | __/|_|\____|\__ (_)
~ |_| |__/
~
~ play! 1.2.5.3, http://www.playframework.org
~ framework ID is test
~
~ Running in test mode
~ Ctrl+C to stop
~
~ Deleting /home/john/bamboo_home/xml-data/build-dir/BAM-BAM-JOB1/tmp
~
CompilerOracle: exclude jregex/Pretokenizer.next
Listening for transport dt_socket at address: 8000
15:46:45,926 INFO ~ Starting /home/john/bamboo_home/xml-data/build-dir/BAM-BAM-JOB1
15:46:47,064 WARN ~ You're running Play! in DEV mode
~
~ Go to http://localhost:9000/@tests to run the tests
~
~ 3 tests to run:
~
~ BasicTest... PASSED 1s
~ ApplicationTest... PASSED 0s
~ Application... PASSED 3s
~
~ All tests passed
~
what am I missing?
Thanks,
John