OpenShift S2I builder image for projects using the Gradle Wrapper
3.2K
OpenShift S2I builder image for projects using the Gradle wrapper.
Assumes the build task will build and test the artifact. If there is another task to run,
set the GRADLE_BUILD_TASK environment variable.
Assumes the build task produces an executable war or jar with
an embedded server. The artifact is started with arguments as follows:
java -jar \
-Dserver.address=${HOST} -Dserver.port=${PORT} \
-Dgrails.server.address=${HOST} -Dgrails.server.port=${PORT} \
${JAVA_OPTS} \
"${ARTIFACT}" \
host=${HOST} port=${PORT}
Using the Gradle wrapper with your project means the particular version of Gradle you want to use will be downloaded on-demand. This builder has OpenJava 1.8.0 installed on CentOS 7.
A proxy repository for artifacts can be configured by setting the
GRADLE_REPO environment variable, such as:
GRADLE_REPO=http://repo:9081/content/groups/public/
The GRADLE_OPTS and/or GRADLE_BUILD_OPTS variables can be set to pass custom options to
the Gradle build. Currently these do the same thing. A future release may apply GRADLE_OPTS
to all Gradle invocations and GRADLE_BUILD_OPTS only to the build invocation.
This builder supports incremental builds. Everything in the Gradle user
home is archived for later builds. You can get this value in your Gradle
build using project.gradle.getGradleUserHomeDir(). For example:
def pathToHoldMyCachedFile = new File(project.gradle.getGradleUserHomeDir(), "myfile.txt")
pathToHoldMyCachedFile.text = "data"
The builder can be imported into OpenShift using the file at image-streams-gradle_wrapper.json
oc login # Use admin credentials
oc create -f image-streams-gradle_wrapper.json -n openshift
Firefox, Google Chrome and PhantomJS are available for testing. See https://bitbucket.org/double16/openshift-s2i-browser-base for details.
Wrappers for the following versions of Gradle are included in the image so that they do not need to be downloaded.
Based on work by https://github.com/anderssv/openshift-sti-java-8
Content type
Image
Digest
Size
1.2 GB
Last updated
over 9 years ago
docker pull pdouble16/openshift-gradle_wrapper