Sonar scanner is not able to create a report-task.txt file - sonarqube-scan

I am running sonar scanner from Jenkins Pipeline on multiple Java projects. All the projects using the below sonar command:
mvn sonar:sonar \
-Dsonar.host.url=${sonar_host_url} \
-Dsonar.login="${SONAR_ACCESS_USERID}"
Dsonar.password="${SONAR_ACCESS_PASSWORD}"\
-Dsonar.projectKey="${scmreponame}" --batch-mode --quiet
but for one of the project I am getting the below error.
"Unable to locate report-task.txt in the workspace. Did the SonarScanner succedeed ? "
I am not able to understand why only for one project it is not able to locate the report.task file?

Related

Differences between databricks dbx execute and launch command

I have a project for which I want to be able to run some entry points on databricks. I used dbx for that, having the following deployment.yaml file:
build:
python: "poetry"
environments:
default:
workflows:
- name: "test"
existing_cluster_id: "my-culster-id"
spark_python_task:
python_file: "file://tests/test.py"
I'm able to run the test script with the execute command:
poetry run dbx execute --cluster-id=my-culster-id test
My problem with this option is that it launches the script interactively and I can't really retrieve the executed code on Databricks, except by looking at the cluster's logs.
So I tried using the deploy and launch commands, such that a proper job is created and run on Databricks.
poetry run dbx deploy test && poetry run dbx launch test
However the job run fails with the following error, which I don't understand:
Run result unavailable: job failed with error message
Library installation failed for library due to user error. Error messages:
'Manage' permissions are required to modify libraries on a cluster
In any case, what do you think is the best way to run a job that can be traced on Databricks from my local machine ?
I've recently added a documentation section on the differences of execute and launch, would that be something that answers your question?

How to build .net core application for debian:jessie

I have created a sample application using .net core. I need to build the application for debian:jessie os. I have following commands
dotnet restore MySampleApp.sln -r -debian:jessie-x64
dotnet build MySampleApp.csproj --verbosity q -c Release -r -debian:jessie-x64
But it shows error message like this
error : NETSDK1056: Project is targeting runtime '-debian:jessie-x64' but did not resolve any runtime-specific packages. This runtime may not be supported by the target framework.
But I can run the same application using alpine Linux without any error
dotnet restore MySampleApp.sln -r alpine.3.7-x64
dotnet build MySampleApp.csproj --verbosity q -c Release -r alpine.3.7-x64
The team has provided a complete list for Runtime IDentifiers on GitHub.
Indeed, there's a RID of alpine.3.7-x64 defined in line30. But as you can see between the line129 and Line233, there's no such a RID whose name is debian:jessie-x64.
You need to use debian.8-x64 instead.

Generating Release APK Fails at bundleReleaseJsAndAssets

Every time I try to run: ./gradlew assembleRelease I get the following:
FAILURE: Build failed with an exception.
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> A problem occurred starting process 'command 'react-native''
Here is the output of the stacktrace: https://gist.github.com/rpastorelle/f0a42a87656e5326a186de4e34f691a0
It does work if I use sudo to run that command. However, that majorly screws up some permissions and then I get "Could not expand ZIP" errors in Android Studio when building a debug version.
My global npm modules are in /usr/local/lib/node_modules & I am the user that owns that folder. react-native-cli was not installed using sudo.
My workaround is to run ./gradlew --stop (which stops the daemon)
If ./gradlew assembleRelease does't want to generate new index.android.bundle file in the assets folder then put the code in app/build.gradle mentioned on https://stackoverflow.com/a/58458802/3880451 to disable bundleJsAndAssets.

How to overcome Could not find or load main class org.testng.TestNG in Jenkins?

I am using selenium 2.47.1 & TestNG for automation process. I'm using Jenkins for continuous integration. Jenkins is installed in Linux server. Jenkins workspace directory is given below : /home/probe7qa/probe7qa.svn/icoreemrtests/onc2014/170.314.a.9/src/eNotes
I have stored lib files in another location. lib files are stored in following path /home/probe7qa/probe7qa.svn/icoreemrtests/onc2014/170.314.a.9/lib
I am using following Shell Command to run Job
java -cp /home/probe7qa/probe7qa.svn/icoreemrtests/onc2014/170.314.a.9/lib/*:/home/probe7qa/probe7qa.svn/icoreemrtests/onc2014/170.314.a.9/src/eNotes/bin org.testng.TestNG testng.xml
Whenever I am trying above Shell Command to run Jenkins job, I'm getting following error [TestNG] [ERROR]
Cannot instantiate class eNotes.ENotes
How to solve this problem...?

Installing Jenkins Plugins to Docker Jenkins

I have the following Dockerfile with jenkins as the base image:
FROM jenkins
USER root
ENV JENKINS_MIRROR http://mirrors.jenkins-ci.org
RUN for plugin in git-client git ws-cleanup ; do wget -O $JENKINS_HOME/plugins/${plugin}.hpi $JENKINS_MIRROR/plugins/${plugin}/latest/${plugin}.hpi ; done
EXPOSE 8080
I'm trying to install some additional plugins but it gives me an error saying no such file or directory
I then started and connected to the container of this build step in order to "debug" the error:
However, I could not find out the cause because every directory seems to exist. Furthermore, if I then run the for-loop manually in the bash, all plugins are installed correctly...
I further noticed, that the installation of the the plugins works, if I install them in the root directory as follows:
RUN for plugin in git-client git ws-cleanup ; do wget -O ${plugin}.hpi $JENKINS_MIRROR/plugins/${plugin}/latest/${plugin}.hpi ; done
However, this is the wrong place as they have to be placed in the directory $JENKINS_HOME/plugins
Why I am not able to install the plugins in $JENKINS_HOME/plugins?
I can't read your screenshots, but you don't seem to be following the official instructions. See https://github.com/cloudbees/jenkins-ci.org-docker under "Installing more tools". Note:
You should save the plugins to /usr/share/jenkins/ref/plugins
You could use a plugins.txt file instead, which contains the names of your plug-ins, and you can process with the provided plugins.sh script. This looks like:
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/plugins.txt
I think the reason your approach wasn't working was to do with some processing in the start-up script.
install-plugins.sh is deprecated. I had to switch to jenkins-plugin-cli:
FROM jenkins/jenkins
...
RUN jenkins-plugin-cli \
--plugins \
git \
workflow-aggregator \
blueocean \
other-plugins
jenkins-plugin-cli also supports -f parameter, which gets the list of plugins as a file.
See Jenkins Official Documentation for details.

Resources