This Wercker step will install Gradle and run a build task for you. Downloading Gradle means that you do not need to have it installed in your box/image, and it will not be included in the image you push at the end of your pipeline - thereby helping to keep your image size as small as possible.
If you specify the cache_project_cache: true
parameter, your Gradle project cache will be placed inside the Wercker cache directory, meaning itwill still be available in subsequent builds, so you will not need to download dependencies, plugins, etc., in every build.
The box that you run this step in must have curl
and unzip
installed. You can install in the in a script
step if they are not in your image.
The box must have a JDK installed, as required by Gradle.
To use the step, include it in your wercker.yml
as in the example below:
build:
steps:
- java/gradle:
task: build
version: 4.0.1
cache_project_cache: true
All paramaters are optional unless otherwise specified.
-
task
(required)
The gradle task(s) to run. -
version
Specify the version of Gradle that you want to use. If not specified, defaults to4.2
. -
build_file
Specify the name of the build file, defaults tobuild.gradle
. -
debug
If set totrue
, will run Gradle in debug mode. -
cache_project_cache
If set totrue
, the Gradle project cache directory (usually<PROJECT_ROOT>/.gradle
) will be placed inside the Wercker cache directory so that it will be available for future executions of the Wercker build (unless the cache is cleared). -
init_script
Specify the filename of the Gradle init script that you wish to run. -
system_props
Provide a space-separated list of system properties that you wish to set during the Gradle build. Specify properties in the formatname=value
. -
settings_file
The filename of the Gradle settings file you wish to use. -
gradle_opts
Specify a value that you want set asGRADLE_OPTS
during the Gradle build.
A sample application is provided at https://github.com/markxnelson/sample-gradle-step that demonstrates how to use this step.