gradle-plugin
gradle-plugin copied to clipboard
Implemented gradle pipeline step
Hey, i've now put some more work on a real gradle pipeline step. This makes it much easier and comfortable running a gradle build in an jenkins pieline.
You are now able to run a gradle build using a predefined gradle with just this little pipeline
node{ gradle gradleName: 'gradle-4.10.2', tasks: 'clean build' }
I've implemented this in our test environment and saved a lot of code in our pipeline script for handling environment variables like PATH and JAVA_HOME catching stderr of gradle logs and so on.
It would be great to get this in so we could use this in our productive environment.
Basically i've moved the main logic of executing gradle into GradleExecution.java so it can now be used by pipeline and freestyle builds as well.
I've installed this in our test environment and it is running very well and has a lot of advantages instead of running a gradle by executing a shell or bat file. It makes it more comfortable, easier and safer to run a gradle build, because you don't have to set any environment variables in dependency to the node you are currently running on.
As i was looking for a solution to our problems i found the ticket JENKINS-44834 and existing pull request. So i first decided to finish the work started there leading to #60. Due the changes made there were prerequisite to implement a real step i've continued the work to implement this step. So in conclusion with this PR the PR #60 is obsolete.
Hey @wolfs , how about this PR, do you have any further questions?
I would really like to see this merged, because it would simplify our jenkins pipeline builds.
If you have any questions please contact me!
Maybe an approach as shown here would be better: https://jenkins.io/blog/2016/04/21/dsl-plugins/
There is also https://github.com/jenkinsci/pipeline-maven-plugin, which seems to use the Step
API.
I'll be closing the PR, given that there hasn't been any recent activity. Is the PR still interesting? If yes, please open a new one based on current main
. Thank you!