Setting up coverity for the Cygwin build environment - code-coverage

I build my project using the cygwin shell inside Windows 10 OS. My project does not build natively in the windows shell.
How can I configure the coverity to run in cygwin shell instead of the default windows shell ?

I needed to do C:\cygwin64\bin\bash --login -c "cd ~/path/to/desired; my_build_command" in the coverity build.

Related

How to pass dotnet tools in to a docker

On root I used :
dotnet tool install --global dotnet-sonarscanner --version 4.7.1to install sonarscanner
and it's working:
SonarScanner for MSBuild 4.7.1
Using the .NET Core version of the Scanner for MSBuild
WARNING: Please specify the command 'begin' or 'end' to indicate whether pre- or post-processing is required. These parameters will become mandatory in a later release.
Post-processing started.
But in a docker it isn't:
root#3bea636a6418:/# dotnet sonarscanner
bash: dotnet: command not found
I tried to pass it:
export PATH="$PATH:/root/.dotnet/tools"
but with no luck
ps. ...and everything because of sonarscanner could not find java on docker:
SonarScanner for MSBuild 5.2
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
Calling the SonarScanner CLI…
Could not find ‘java’ executable in JAVA_HOME or PATH.
The SonarScanner did not complete successfully
14:43:39.402 Post-processing failed. Exit code: 1
Cleaning up file based variables
ERROR: Job failed: exit code 1```
Install all the dependencies for your dotnet tools to work, ldd command can help you with this, and make sure all software required can be found also, for example can be found on the PATH variable if required.
to help you use interactive bash on the docker container, and add to your dockerfile if this works.
docker exec -it (container) bash
docker images usually installs what is required only, so you add the tools only to run your software successfully.
- apt-get update
- apt-get install --yes openjdk-11-jre
solved problem
ps. it's not that obvious because in docker bash when I run java -version I get answer that java is already installed

How to find Jenkins version through CLI command? Is there any command like "java - version"

Find Jenkins version in CLI Command.
I can tell there are 3 ways to do it.
Open config file from the installation directory
cd /var/lib/Jenkins/
Open config.xml file, to see the version.
Available in bottom of Jenkins’s UI.
grep "version>" /var/lib/jenkins/config.xml
This is the way!
java -jar /usr/share/jenkins/jenkins.war --version
Thank you, #Bala Senthil. I don't have enough reputation to comment it. That is why I'm posting it is an answer. On CentOS7 the below one is working, just a change in the path - instead of /usr/share/jenkins/.... it is /usr/lib/jenkins...
java -jar /usr/lib/jenkins/jenkins.war --version
We wanted to track our Jenkins version in another app, so we wanted it. This is my use case.
Yes, to get the current version of jenkins you can execute
jenkins --version
The jenkins executable in /usr/bin is a shell script that determines where the jenkins war is located, and then runs commands against it.
$ jenkins --help
Running from: /usr/share/java/jenkins.war
webroot: $user.home/.jenkins
Jenkins Automation Server Engine 2.332.2
Usage: java -jar jenkins.war [--option=value] [--option=value]
...
a bunch of options to pass to the war file

Jenkins couldn't recognize Python run from .BAT file

I'm a beginner to Jenkins, and trying to run a small Python code from Jenkins batch command for Windows.
However, the build run throws below error:
Running as SYSTEM
Building in workspace C:\Program Files (x86)\Jenkins\workspace\PythonProject1
[PythonProject1] $ cmd /c call C:\Windows\TEMP\jenkins7865401366299588301.bat
C:\Program Files (x86)\Jenkins\workspace\PythonProject1>cd C:\Users\Ben\Desktop\py
C:\Users\Ben\Desktop\py>python C:\Users\Ben\Desktop\py\for.py
'python' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Ben\Desktop\py>exit 9009
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
Python is installed in my machine and is declared in Environment Variable too. What am I missing?
"Running as SYSTEM" means the Jenkins service is not running with your account, but the Windows system account, used as a service account.
That means you need to add python path to the system environment variables, not the user ones.

Build/deploy Vue.js project through Jenkins

I am new to Jenkins but have done a few builds/deployment jobs of .net project successfully.
Now I am trying to build/deploy Vue.js project through Jenkins but just cannot get through...
I can build the project directly on a server using command prompt. It builds and creates files for deployment in a right directory.
When I am trying to do it in Jenkins job (using the same npm commands) it does not give any error messages, says it built successfully but it does NOT create any files for deployment.
Does anybody encounter this problem? Did anybody build Vue js project through Jenkins? Any help appreciated. Thanks!
In execute windows batch command I run:
cd myworkdirectory
npm install
npm run build
Not too complex, as I found.
Create freestyle project.
In section Source Code Management please define your repository.
In section Build Triggers please define triggers
In section Build define either Execute Windows batch command or Execute shell within sections like (my choice in the moment - windows):
git checkout develop
npm -g install
npm run build
del /s /f /q c:\applications\frontend-app-build\*.*
for /f %%f in ('dir /ad /b c:\applications\frontend-app-build\') do rd /s /q c:\applications\frontend-app-build\%%f
robocopy dist c:\applications\frontend-app-build\ /E

Jenkins dotnet command not found

I am trying to setup CI locally with Jenkins on OSX, however I am having some issues when trying to execute shell commands. Here are the commands I am trying to run in the Jenkins configuration:
cd /Users/username/projectname
dotnet build HD-Project.sln
However, when I try and build the project, I get the following errors:
Building in workspace /Users/Shared/Jenkins/Home/workspace/HD-Build
[HD-Build] $ /bin/sh -xe
/Users/Shared/Jenkins/tmp/jenkins2699993427980474696.sh
+ cd /Users/username/projectname
+ dotnet build HD-Project.sln
/Users/Shared/Jenkins/tmp/jenkins2699993427980474696.sh: line 3:
dotnet: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Any help would be greatly appreciated, thanks.
I got this working, and was successfully able to run dotnet commands through an executed shell via Jenkins.
To run dotnet commands, the .NET SDK needs to be installed on the Jenkins build server. Instructions on how to install the .NET SDK can be found here: https://www.microsoft.com/net/learn/get-started/macos for all OS - Linux, MacOS and Windows.
This happens because the installation package does not add the dotnet executable location to the PATH environment variable. This issue is mentioned in https://github.com/dotnet/core/blob/master/cli/known-issues.md#users-of-zsh-z-shell-dont-get-dotnet-on-the-path-after-install, but apparently it does not affect only zsh users. You need to add this path manually.
In my case the path was /usr/local/share/dotnet, so I ran (from the command line):
export PATH=/usr/local/share/dotnet:$PATH
Taken from https://github.com/dotnet/cli/issues/4357

Resources