Drone and gradle

Hello,
we are currently using some other CICD with a lot of gradle build steps/tasks (so actually CI/CD is a kind of trigger for gradle tasks). Can anybody share with me please his/her experience with poring gradle-oriented tasks to Drone ? Is it easy/not easy ?
Thanks

I do not have any gradle experience, but it should be relatively simple. You would create a pipeline and execute your gradle tasks in the commands section as demonstrated here:
https://docs.drone.io/examples/language/gradle/

Hello,

I faced with an issue, that gradle container runs under user “gradle” (gid/uid 1000) but drone tasks (like clone) runs under root user.
And when I try to run gradle task I hits an error like “Failed to load native library ‘libnative-platform.so’ for Linux amd64”
because all files belongs to root user, but command is trying to run under gradle user.

How possible to specify user(uid) for the task?

As of Drone version 1.1 you can specify user: root for the pipeline step. See https://github.com/drone/drone/issues/2651

1 Like

It works!
Thank you! :slight_smile:

@bradrydzewski,
I have finally tried drone with gradle and got the following error:

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

  • What went wrong:

Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().

Could not create service of type CrossBuildFileHashCache using BuildSessionScopeServices.createCrossBuildFileHashCache().

How should I fix it ?

see the fix suggested above

Thanks @bradrydzewski - that helped !