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
It did not work, I got ./gradlew is not found error. I am using Java 11. Should I configure Gradle for each steps?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe it just needs java so you could use
image: java:7
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got bash: ./gradlew: Permission denied
bash: ./gradlew: Permission denied
Error. What should I do?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I try the following:
pipelines: default: - step: script: # Modify the commands below to build your repository. - chmod +x gradlew - ./gradlew assembleDebug
Unfortunately it did not works for me. I didnt have permission to change the file access.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Because it's a Bash script, you can just write - bash ./gradlew assembleDebug
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It works! Thank you!
So the correct bitbucket-pipelines.yml content is:
image: java:7 pipelines: default: - step: script: - bash ./gradlew assembleDebug
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Carey Evans, I am following above tutorial, but build is failing .
Logs says that:-
bash: ./gradlew: No such file or directory
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Kashif. It looks like "gradle build" with the qlik/gradle image will work. It's still failing, but on a missing JavaFX jar. The command is successfully invoked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apologies all. You need to either commit the wrapper as an executable
chmod +x gradlew
or run it through bash:
image: java:8 pipelines: default: - step: script: - bash ./gradlew clean build
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Sigge Birgisson,
I followed your above mentioned url i,e
https://bitbucket.org/hascode/bitbucket-vertx3-pipeline/src/a2befa4ce4b15d970d9c4f7952ebf2578861f6b3/bitbucket-pipelines.yml?at=master&fileviewer=file-view-default
and 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/gradle
pipelines:
default:
- step:
script:
- gradle clean
- gradle test
- gradle ear
but 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 pipeline
Can you help me?
thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 project
gradlewrapper: ~/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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Joshua Tjhin,
I followed follwing
https://bitbucket.org/hascode/bitbucket-vertx3-pipeline/src/a2befa4ce4b15d970d9c4f7952ebf2578861f6b3/bitbucket-pipelines.yml?at=master&fileviewer=file-view-default
and 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/gradle
pipelines:
default:
- step:
script:
- gradle clean
- gradle test
- gradle ear
but 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 pipeline
Can you help me?
thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.