I am using gradle, what do I need to do?
Our recommended approach (and Gradle's) to building Gradle projects is to commit the Gradle Wrapper to your repository.
The Gradle wrapper ensures two things:
We recommend making the wrapper script executable before committing it to your repository. In Unix/Mac:
chmod +x gradlew
Then you can build your Gradle project with the wrapper:
image: java:8 pipelines: default: - step: script: - bash ./gradlew build
One example using gradle can be found here: https://bitbucket.org/hascode/bitbucket-vertx3-pipeline
Kudos to Micha Kops, http://www.hascode.com/2016/07/continuous-delivery-with-bitbucket-cloud-and-bitbucket-pipelines/
If you have a the Gradle Wrapper committed to your repository, it's as easy as:
image: java:8 pipelines: default: - step: script: - bash ./gradlew clean build
Does it have to be `java:8`? Is 7 supported?
I believe it just needs java so you could use
image: java:7
I got bash: ./gradlew: Permission denied
bash: ./gradlew: Permission denied
Error. What should I do?
@Sigge Birgisson,I followed your above mentioned url i,ehttps://bitbucket.org/hascode/bitbucket-vertx3-pipeline/src/a2befa4ce4b15d970d9c4f7952ebf2578861f6b3/bitbucket-pipelines.yml?at=master&fileviewer=file-view-defaultand here is my script:-
# This is a sample build configuration for Gradle.# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples.# Only use spaces to indent your .yml configuration.# -----# You can specify a custom docker image from Docker Hub as your build environment.image: qlik/gradlepipelines: default: - step: script:- gradle clean - gradle test - gradle earbut previously it was working fine from last 2 months, but today when i start build, it fails on gradle clean command by saying that:-.sh line 22 gradle command not found bibucket pipelineCan you help me?thanks in advance
@Joshua Tjhin,
I followed follwing
https://bitbucket.org/hascode/bitbucket-vertx3-pipeline/src/a2befa4ce4b15d970d9c4f7952ebf2578861f6b3/bitbucket-pipelines.yml?at=master&fileviewer=file-view-defaultand here is my script:-
# This is a sample build configuration for Gradle.# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples.# Only use spaces to indent your .yml configuration.# -----# You can specify a custom docker image from Docker Hub as your build environment.image: qlik/gradlepipelines:default:- step:script:- gradle clean- gradle test- gradle earbut previously it was working fine from last 2 months, but today when i start build, it fails on gradle clean command by saying that:-.sh line 22 gradle command not found bibucket pipelineCan you help me?thanks in advance
I have gradle wrapper running in pipeline, but every step it re-downloads the gradle files even I set
caches:- gradle- gradlewrapper
definitions:caches: #location of wrapper in my projectgradlewrapper: ~/gradle/wrapper
After I check the pipeline log, I see that the pipeline download gradle wrapper to `.gradle/wrapper`, so why is it a different location?
It did not work, I got ./gradlew is not found error. I am using Java 11. Should I configure Gradle for each steps?
It looks like you're new here. Sign in or register to get started.