Hi,
We are trying to decorate bitbucket with Sonarcloud for every pull request and commit for a project with gradle build.
As a part of this, we have created a bitbucket-pipelines.yml file and used the standard pipeline syntax for a gradle technology, but while executing/running the bitbucket-pipeline we are facing the following error:
Set executable permissions for: /root/.gradle/wrapper/dists/gradle-2.1-all/27drb4udbjf4k88eh2ffdc0n55/gradle-2.1/bin/gradle
Yml Script: Standard Bitbucket yml template for gradle build:
script:
- ./gradlew build sonarqube
artifacts:
- build/libs/**
This build was successfull in local and also in Jenkins but not through Bitbucket. Can someone please suggest what needs to be done here?
Thank you,
Hello @Vishal_infy,
What Docker image are you using? Please post entire Pipelines configuration file, otherwise it's hard to guess what's wrong. Actually, in the message you've posted there's no indication of any errors. I assume there're few more lines pointing to the actual error.
In general, Pipelines run your script in the Docker image you specified (or in default image, if you didn't). You can troubleshoot the issue you're facing by running your script step by step inside a Docker container locally, here's a guide on how to do that.
Hope this helps. Let me know if you have any questions.
Cheers,
Daniil
Hi @Daniil Penkin ,
Following is the yml script which i am using to run the pipeline. Please let me know if anything is wrong in this:
image: openjdk:11
clone:
depth: full # SonarCloud scanner needs the full history to assign issues properly
definitions:
caches:
sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
steps:
- step: &build-test-sonarcloud
name: Build, test and analyze on SonarCloud
caches:
- gradle
- sonar
script:
- bash ./gradlew clean build
artifacts:
- build/libs/**
pipelines:
branches:
'**':
- step: *build-test-sonarcloud
pull-requests:
'**':
- step: *build-test-sonarcloud
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looking at Gradle wrapper's code I can see that this message is not an error, rather an expected behaviour:
Set executable permissions for ...
So the reason why the build failed is somewhere else.
I'd recommend to try debugging your pipeline locally. Basically, you can run openjdk:11 Docker container locally with your repository working directory mounted as a volume, and then run your script commands one by one.
I also noticed that the wrapper is for Gradle 2.1 which is pretty old. Are you running the build locally using the wrapper? If not, maybe you have more recent version of Gradle but haven't updated the wrapper for quite some time?
Hope this helps.
Cheers,
Daniil
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.