Plugin Information |
---|
View Play Framework on the plugin site for more information. |
This plugin is up for adoption. Want to help improve this plugin? Click here to learn more!
Play Framework plugin
The Play Framework plugin brings the command-line capabilities of Play and Activator into the Jenkins environment, integrating these powerful tools to the most widely used Continuous Integration platform. This way, Play projects can benefit from the growing number of features provided by the Jenkins community while improving the traceability of their build elements and visualisation of the respective results.
The plugin supports Play 1.x, Play 2.x as well as Activator projects. It provides a smart selection of most commands available in their CLI. Moreover, it’s also possible to input custom commands via Jenkins interface.
Global Configuration
In Manage Jenkins, Configure System, a new section will be available: Play.
Select Add Play and give it a name and the PLAY_HOME path. Play Framework or Activator tools can be provided also via Install automatically option, when properly configured.
Save the configuration and move forward.
Job Configuration
Open/create a Jenkins job. Add a build-step Invoke Play Framework.
Select the Play or Activator tool provided in the global configuration. Provide also the project path and the command set (Play 1.x or Play 2.x, which includes the Activator as well).
Several Goals are listed below according to the selected command set. Create your sequence of goals in the desired order. Commands are executed from top to bottom. A description is provided for each goal right below their respective title.
Save your job configuration and you are ready to go!
Workflow plugin compatibility
Starting from version 0.2.0, Play Framework plugin can be used within the Workflow plugin for Jenkins. This allows your Play project to be inserted into a more complex build environment that only Workflow provides. Delivery Pipelines are one of the main benefits, allowing higher parallelism and better control of the build chain.
In order to use it, simply create a new Workflow job and use its Snippet Generator feature to create the Play command from the already known User Interface.
Select General Build Step and Invoke Play Framework.
Fill up the fields and select the goals as in a regular Freestyle Project.
Pressing Generate Groovy will provide the complete Groovy command.
Copy the command and paste it into the Groovy text field. The node function is a basic requirement for any script executed within the Workflow plugin.
Copy the command and paste it into the Groovy text field. The node function is a basic requirement for any script executed within the Workflow plugin.
Change log
Version 1.0.1 (Feb 8, 2016)
- Windows compatibility fixed. (JENKINS-31851)
Version 1.0.0 (Nov 20, 2015)
- New interface: Play goals configurable via dropdown menus.
- Play tool installation implemented. (JENKINS-31528)
Version 0.0.12 (Sep 29, 2011)
- Bug fix: ensure job doesn't fail without configuring application path
Version 0.0.11 (Sep 28, 2011)
- Bug fix: to resolve workspace path when used in slave server
Version 0.0.10 (Sep 21, 2011)
- Modified supported Jenkins version number for adapting Cloudbees support
Version 0.0.9 (Sep 18, 2011)
- Supported to allow using parameterized build
- Enable to configure play application path instead of using the workspace root path as application path
- Ensure to quote application path when executing
Version 0.0.8 (Jul 27, 2011)
- Enable to run multiple commands at once with each options
Version 0.0.5 (Jul 3, 2011)
- Enable to configure play path per job
Version 0.0.4 (Feb 7, 2011)
- Fixed a bug builder's global.jelly misses its setting after Jenkins restart
- Supported unstable build status when some tests failed
Version 0.0.1 (Jan 25, 2011)
- First release
7 Comments
Unknown User (ladlestein)
We've started using the plugin and it's working for us, but recently I noticed that a module build failed to compile but was still marked as a success.
Really, it looks like a Play problem; the build-module command ignores the compilation errors and continues, creating a package and returning SUCCESS. But I'm posting it here anyway so people know about it
Here's some of the log:
Started by user anonymous
Checkout:workspace / /var/lib/jenkins/jobs/stuff/workspace - hudson.remoting.LocalChannel@59338918
Using strategy: Default
Last Built Revision: Revision xxx (origin/master)
Checkout:workspace / /var/lib/jenkins/jobs/stuff/workspace - hudson.remoting.LocalChannel@59338918
Fetching changes from 1 remote Git repository
Fetching upstream changes from git@github.com:ourco/stuff.git
Commencing build of Revision xxx (origin/master)
Checking out Revision xxx (origin/master)
play path is /opt/stuff/play/play
Executing /opt/stuff/play/play dependencies "/var/lib/jenkins/jobs/stuff/workspace" --sync
workspace $ /opt/stuff/play/play dependencies /var/lib/jenkins/jobs/stuff/workspace --sync
~ Resolving dependencies using /var/lib/jenkins/jobs/stuff/workspace/conf/dependencies.yml,
~
skipping boring parts of the log~
~
~ Done!
~
~ _ _
~ _ __ | | __ _ _ _| |
~ | '_ | |/ ' | || ||
~ | _/||___|_ (_)
~ || |_/
~
~ play! 1.2.3, http://www.playframework.org
~ framework ID is stage
~
Executing /opt/stuff/play/play build-module "/var/lib/jenkins/jobs/stuff/workspace"
workspace $ /opt/stuff/play/play build-module /var/lib/jenkins/jobs/stuff/workspace
Buildfile: /var/lib/jenkins/jobs/stuff/workspace/build.xml
clean:
build:
mkdir Created dir: /var/lib/jenkins/jobs/stuff/workspace/tmp/classes
scalac Compiling 23 source files to /var/lib/jenkins/jobs/stuff/workspace/tmp/classes
scalac /var/lib/jenkins/jobs/stuff/workspace/src/stuff/models/DbPool.scala:8: error: value squeryl is not a member of package org
scalac import org.squeryl.PrimitiveTypeMode._
scalac ^
scalac /var/lib/jenkins/jobs/stuff/workspace/src/stuff/models/Dbify.scala:3: error: value squeryl is not a member of package org
scalac import org.squeryl._
scalac ^
scalac /var/lib/jenkins/jobs/stuff/workspace/src/stuff/models/Dbify.scala:30: warning: type <error> in type pattern <error> is unchecked since it is eliminated by erasure
scalac case error: Throwable => {
scalac ^
skipping more boring parts of the log
scalac ^
scalac 9 warnings found
scalac 12 errors found
BUILD FAILED
/var/lib/jenkins/jobs/stuff/workspace/build.xml:34: Compile failed with 12 errors; see the compiler error output for details.
Total time: 12 seconds
~ _ _
~ _ __ | | __ _ _ _| |
~ | '_ | |/ ' | || ||
~ | _/||___|_ (_)
~ || |_/
~
~ play! 1.2.3, http://www.playframework.org
~ framework ID is stage
~
~
~ Building...
~
~
~ Packaging workspace-0.1 ...
~
~ Done!
~ Package is available at /var/lib/jenkins/jobs/stuff/workspace/dist/workspace-0.1.zip
~
Each commands' results:
build-module: Done
dependencies --sync: Done
Sending e-mails to: larry@ourco.com
Finished: SUCCESS
Unknown User (martinhbramwell)
Hi Takafumi Ikeda
I'd very much like to get started with your Play! Framework plugin, but I get, "... marked build as failure. " no matter what I try.
Is there any way to debug that? As it is there is no debugging information, and every different thing I try gets me the same result.
I'm running Jenkins 1.450. Is your plugin supported? Is your plugin affected by Jenkin's change of location of the workspace?
Thanks,
Hasan
Unknown User (ikeike443)
Hi,
Sorry for late. I've just found this comment right now.
Can you find any information on PlayWithPlay/helloworld/logs/applicationlog? (its file name might be different, systems.out or something)
Unknown User (touko)
I'm having problems with play-plugin & environment variables for application.conf injected with EnvInject plugin.
I want to avoid having a secret token in application.conf in version control, so I have the following in the application.conf:
I have file environment-ci.properties:
In Build setup I have:
When job is run, console output has the following:
So the FOOTEST environment variable doesn't seem to be present.
Don't know if this is related more to play-plugin or EnvInject. Anyway, any ideas?
Unknown User (touko)
Same also if I try to use EnvInject through
Unknown User (swastb)
does it support Play framework version 2.2.3? We are getting invalid syntax error when using with 2.2.3, because this plugin appends the work space directory in the play command.
Unknown User (pkamath)
We had an issue with an unresolved dependency for the play framework. The build was being marked as a success even when it failed and we missed this for quite a dew days. This is the tail end of the Jenkins build output
We are using the following
=================================================================
:
:
:
:
======================================================================================================================