Using Gradle in Pipeline

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using Gradle in Pipeline

Sverre Moe-2
We are currently using Maven for building our applications. 

Our Jenkins maven pipeline are using the withMaven step from Pipeline Maven Integration.

I have written gradle build scripts for our projects and begun to write the Pipeline build script to build gradle.

We could really use an Pipeline Gradle Integration plugin and an withGradle step.

In the absence of such a plugin I am left with
tool name: 'gradle-4.6', type: 'gradle'
sh
"gradle build"

I think I have to put some verbosity to gradle. The Jenkins console output did not provide any insight while gradle was running the JUnit tests.

:processResources
:classes
:jar
:javadoc
:javadocJar
:sourcesJar
:assemble
:startMockServer
:processTestResources
:testClasses
:test
:stopMockServer
:check
:build

After :test there was no output for about 2 minutes. Not until task test was finished.
Not knowing if the build has halted, a test taking to long, or some other problem.

Would be great to have something like the dynamic output from running gradle
<=========----> 75% EXECUTING [15s]
> :test > 100 tests completed
> :test > Executing test com.company.api.ConnectionTest


Running Gradle with --console=rich gives me this output, but it is a mess.

:test [m [0K [7D [1B [2A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [9s] [m [34D [1B [1m> :test [m [7D [1B [2A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [9s] [m [34D [1B [1m> :test > 0 tests completed [m [27D [1B [2A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [9s] [m [34D [1B [1m> :test > 0 tests completed [m [27D [1B [2A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [9s] [m [34D [1B [1m> :test > 0 tests completed [m [27D [1B [2A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [9s] [m [34D [1B [1m> :test > 0 tests completed [m [27D [1B [2A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [9s] [m [34D [1B [1m> :test > 0 tests 
...
...
> 330 tests completed [m [29D [1B [1m> :test > Executing test com.company.server.api.commands.Command1Test [m [0K [68D [1B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 29s] [m [38D [1B [1m> :test > 412 tests completed [m [29D [1B [1m> :test > Executing test com.company.server.api.commands.Command2Test [m [76D [1B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 29s] [m [38D [1B [1m> :test > 507 tests completed [m [29D [1B [1m> :test > Executing test com.company.server.api.commands.Command3Test [m [0K [68D [1B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 29s] [m [38D [1B [1m> :test > 661 tests completed [m [29D [1B> IDLE [0K [6D [1B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 29s] [m [38D [1B [1m> :test > 661 tests completed [m [29D [2B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 29s] [m [38D [1B [1m> :test > 661 tests completed [m [29D [2B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 30s] [m [38D [1B [1m> :test > 661 tests completed [m [29D [2B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 30s] [m [38D [1B [1m> :test [m [0K [7D [2B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 30s] [m [38D [1B [1m> :test [m [7D [2B [3A [0K
[0K
[32;1mBUILD SUCCESSFUL [0;39m in 1m 32s
11 actionable tasks: 11 executed



Are anyone using gradle in their Jenkins pipeline?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6474a26a-de71-4c00-a5d3-ee0edbd49a79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Using Gradle in Pipeline

Francesco Sisca

check configuration of gradle in your global configuration tools (into jenkins manage)



this is my pipeline:


pipeline {

    agent any
        tools {
        gradle "gradle"
    }
    environment{
        ANDROID_HOME="/opt/sdk-tools-linux-3859397"
        PATH="${PATH}:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools"
    }





Il giorno venerdì 13 aprile 2018 08:02:43 UTC+2, Sverre Moe ha scritto:
We are currently using Maven for building our applications. 

Our Jenkins maven pipeline are using the withMaven step from Pipeline Maven Integration.

I have written gradle build scripts for our projects and begun to write the Pipeline build script to build gradle.

We could really use an Pipeline Gradle Integration plugin and an withGradle step.

In the absence of such a plugin I am left with
tool name: 'gradle-4.6', type: 'gradle'
sh
"gradle build"

I think I have to put some verbosity to gradle. The Jenkins console output did not provide any insight while gradle was running the JUnit tests.

:processResources
:classes
:jar
:javadoc
:javadocJar
:sourcesJar
:assemble
:startMockServer
:processTestResources
:testClasses
:test
:stopMockServer
:check
:build

After :test there was no output for about 2 minutes. Not until task test was finished.
Not knowing if the build has halted, a test taking to long, or some other problem.

Would be great to have something like the dynamic output from running gradle
<=========----> 75% EXECUTING [15s]
> :test > 100 tests completed
> :test > Executing test com.company.api.ConnectionTest


Running Gradle with --console=rich gives me this output, but it is a mess.

:test [m [0K [7D [1B [2A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [9s] [m [34D [1B [1m> :test [m [7D [1B [2A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [9s] [m [34D [1B [1m> :test > 0 tests completed [m [27D [1B [2A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [9s] [m [34D [1B [1m> :test > 0 tests completed [m [27D [1B [2A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [9s] [m [34D [1B [1m> :test > 0 tests completed [m [27D [1B [2A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [9s] [m [34D [1B [1m> :test > 0 tests completed [m [27D [1B [2A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [9s] [m [34D [1B [1m> :test > 0 tests 
...
...
> 330 tests completed [m [29D [1B [1m> :test > Executing test com.company.server.api.commands.Command1Test [m [0K [68D [1B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 29s] [m [38D [1B [1m> :test > 412 tests completed [m [29D [1B [1m> :test > Executing test com.company.server.api.commands.Command2Test [m [76D [1B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 29s] [m [38D [1B [1m> :test > 507 tests completed [m [29D [1B [1m> :test > Executing test com.company.server.api.commands.Command3Test [m [0K [68D [1B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 29s] [m [38D [1B [1m> :test > 661 tests completed [m [29D [1B> IDLE [0K [6D [1B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 29s] [m [38D [1B [1m> :test > 661 tests completed [m [29D [2B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 29s] [m [38D [1B [1m> :test > 661 tests completed [m [29D [2B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 30s] [m [38D [1B [1m> :test > 661 tests completed [m [29D [2B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 30s] [m [38D [1B [1m> :test [m [0K [7D [2B [3A [1m< [0;32;1m========= [0;39;1m----> 75% EXECUTING [1m 30s] [m [38D [1B [1m> :test [m [7D [2B [3A [0K
[0K
[32;1mBUILD SUCCESSFUL [0;39m in 1m 32s
11 actionable tasks: 11 executed



Are anyone using gradle in their Jenkins pipeline?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/efa58033-672a-4803-b56d-4fe5acf5a064%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.