Skip to end of metadata
Go to start of metadata

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)
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

  1. 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 (smile)

    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

  2. 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

     Started by user anonymous
    Building in workspace /home/jenkins/.jenkins/workspace/PlayWithPlay
    [PlayWithPlay] $ /bin/sh -xe /usr/share/tomcat/temp/hudson588869528219453871.sh
    + echo Path to Play!
    Path to Play!
    + ls /usr/share/play-1.2.4
    COPYING
    documentation
    framework
    modules
    play
    play.bat
    python
    README.textile
    resources
    samples-and-tests
    support
    + echo Path to play application.
    Path to play application.
    + ls /home/jenkins/.jenkins/workspace/PlayWithPlay/helloworld
    app
    conf
    lib
    logs
    public
    test
    test-result
    tmp
    + echo Default path (pwd)
    Default path (pwd)
    + pwd
    /home/jenkins/.jenkins/workspace/PlayWithPlay
    play path is /usr/share/play-1.2.4
    Executing /usr/share/play-1.2.4 clean "/home/jenkins/.jenkins/workspace/PlayWithPlay/helloworld"
    [helloworld] $ /usr/share/play-1.2.4 clean /home/jenkins/.jenkins/workspace/PlayWithPlay/helloworld
    Build step 'Play!' marked build as failure
    Finished: FAILURE
    
    1. 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)

  3. 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:

    %ci.organisationservice.token=${FOOTEST}

    I have file environment-ci.properties:

    FOOTEST=footest
    ...

    In Build setup I have:

    • Inject environment variables
      • Properties File Path : environment-ci.properties
    • Execute shell
      • Some other setup things
      • Debug line for testing the environment variable injection:
        • env | grep FOOTEST
    • Play! part
      • clean, deps, run (with environment specified)

    When job is run, console output has the following:

    ...
    [EnvInject] - Injecting as environment variables the properties file path 'environment-ci.properties'
    ...
    // From the debug line:
    FOOTEST=footest
    ...
    -> WARNING: Cannot replace FOOTEST in configuration (organisationservice.token=${FOOTEST})

    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?

    1. Same also if I try to use EnvInject through

      • Build environment -> Inject environment variables to the build process
  4. 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.

  5. 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 

    • Play framewrok 2.2.6
    • Commans Set : Play 2.x
    • Jenkins Play framework plugin version : 1.0.2

     

    =================================================================

    :

    :

    :

    :

    [warn] 	::::::::::::::::::::::::::::::::::::::::::::::
    
    sbt.ResolveException: unresolved dependency: com.typesafe.sbtrc#client-2-11;0.3.1: not found
    unresolved dependency: com.typesafe.sbtrc#actor-client-2-11;0.3.1: not found
    	at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:217)
    	at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:126)
    	at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:125)
    	at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:115)
    	at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:115)
    	at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:103)
    	at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:48)
    	at sbt.IvySbt$$anon$3.call(Ivy.scala:57)
    	at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:98)
    	at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:81)
    	at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:102)
    	at xsbt.boot.Using$.withResource(Using.scala:11)
    	at xsbt.boot.Using$.apply(Using.scala:10)
    	at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:62)
    	at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:52)
    	at xsbt.boot.Locks$.apply0(Locks.scala:31)
    	at xsbt.boot.Locks$.apply(Locks.scala:28)
    	at sbt.IvySbt.withDefaultLogger(Ivy.scala:57)
    	at sbt.IvySbt.withIvy(Ivy.scala:98)
    	at sbt.IvySbt.withIvy(Ivy.scala:94)
    	at sbt.IvySbt$Module.withModule(Ivy.scala:115)
    	at sbt.IvyActions$.update(IvyActions.scala:125)
    	at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1223)
    	at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1221)
    	at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$74.apply(Defaults.scala:1244)
    	at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$74.apply(Defaults.scala:1242)
    	at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
    	at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1246)
    	at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1241)
    	at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
    	at sbt.Classpaths$.cachedUpdate(Defaults.scala:1249)
    	at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1214)
    	at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1192)
    	at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    	at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
    	at sbt.std.Transform$$anon$4.work(System.scala:64)
    	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    	at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    	at sbt.Execute.work(Execute.scala:244)
    	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    	at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    	at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    	at java.util.concurrent.FutureTask.run(Unknown Source)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    	at java.util.concurrent.FutureTask.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    [error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.sbtrc#client-2-11;0.3.1: not found
    [error] unresolved dependency: com.typesafe.sbtrc#actor-client-2-11;0.3.1: not found
    [error] Total time: 8 s, completed Aug 21, 2017 3:09:13 PM
    Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
    Build step 'Invoke Play Framework' changed build result to SUCCESS
    Finished: SUCCESS

    ======================================================================================================================