Msbuild file with grunt giving error while executing from Jenkins - jenkins

I am executing my Msbuild file from Jenkins using below command using Execute windows batch command option.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild "D:****\Build Scripts\BuildAndDeploy.proj"
this command executing perfectly from command prompt but in jenkins I am getting below error...
'grunt' is not recognized as an internal or external command,
operable program or batch file.
D:****\Build Scripts\BuildAndDeploy.proj(29,3): error MSB3073: The command "grunt build" exited with code 9009.
Done Building Project "D:*****\Build Scripts\BuildAndDeploy.proj" (default targets) -- FAILED.
Build FAILED.
Please suggest me how to handle this.
Thanks in advance.

Related

issue in jenkins integration with git

i installed jenkins in c:\program files(x86)\jenkins and am trying to integrate with a helloworld java file. but when i first tried to build from jenkins, itself, its failed.
i went through this link : https://www.youtube.com/watch?v=bGqS0f4Utn4
when i compiled my java file, from the admin cmd prompt, its compiles successfully. but it failed within the jenkins console.
I created a C:\workspace folder and saved the java file, there.
what am doing wrong ? why am getting the wrong path within the console output?
am getting the below error in the console output :
`Console Output
Started by user user1
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building in workspace C:\Program Files (x86)\Jenkins\workspace\
HelloWorld
[HelloWorld] $ cmd /c call C:\Windows\TEMP\jenkins6223662388306682118.bat
C:\Program Files (x86)\Jenkins\workspace\HelloWorld>cd C:\Workspace
C:\Workspace>javac Hello.java
'javac' is not recognized as an internal or external command,
operable program or batch file.
C:\Workspace>java Hello
'java' is not recognized as an internal or external command,
operable program or batch file.
C:\Workspace>exit 9009
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
First, since you've installed JDK, make sure you've added in system level environment variable
Set JDK bin path in Jenkins > manage jenkins > global tools configurations > jdk installations, then try
mostly this option would help to resolve

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.

error : Web deployment task failed. (Unknown ProviderOption:DefiningProjectFullPath)

All the solutions provided in stack for below error didn't help me. I am using /p:VisualStudioVersion=10.0 /p:Configuration=Release
/p:DesktopBuildPackageLocation=$WORKSPACE\package.zip /t:Package has Command Line Arguments under Jenkins job to run MSBuild proj. "package.zip" file is not getting created under my work-space if I use /p:DesktopBuildPackageLocation=some\package.zip Please suggest me command Line arguments. I am using Upload artifact to Nexus plugin as well to upload this zip file.
error : Web deployment task failed. (Unknown ProviderOption:DefiningProjectFullPath. Known ProviderOptions are:.)

Jenkins cannot run program sonar-runner

Installed:
Sonarqube 5.5
Sonar-runner 2.4 (http://dev.mamikon.net/installing-sonarqube-runner-on-ubuntu/)
When I try to run Jenkins with a simple project, this is the error I get:
[test] $ sonar-runner -e
-Dsonar.host.url=http://server_url:9000/sonar/ -Dsonar.projectBaseDir=/var/lib/jenkins/workspace/test
SONAR ANALYSIS FAILED
FATAL: command execution failed. java.io.IOException: Cannot run
program "sonar-runner" (in directory
"/var/lib/jenkins/workspace/test"): error=2, No such file or directory
It seems that jenkins cannot find the sonar-runner program.
But when I open the server with a terminal, and run sonar-runner, it analyzes the project.
Can someone help me with this?
after hours of frustration, it turned out i had to add environment variable in the /etc/profile file.
export SONAR_RUNNER_HOME=/opt/sonar-runner
export PATH=$PATH:$SONAR_RUNNER_HOME/bin

Jenkins - Cannot proceed with MSBuild

I have worked almost one day with Jenkins to setup for automation publishing an ASP.NET web application. I have got it done in one local virtual machine, but it did not work when I tried with an production server.
Could any one can help or advise me? Here is the console error output:
......
no change for **SVNpath**1 since the previous build
Path To MSBuild.exe: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe
Executing command: cmd.exe /C C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe /t:rebuild D:\JenkinsInstall\jobs\ADDevelopmentPublishing\workspace\Web\ABC\ABC.csproj && exit %%ERRORLEVEL%%
[workspace] $ cmd.exe /C C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe /t:rebuild D:\JenkinsInstall\jobs\ADDevelopmentPublishing\workspace\Web\ABC\ABC.csproj && exit %%ERRORLEVEL%%
The command prompt has been disabled by your administrator.
Press any key to continue . . .
Build step 'Build a Visual Studio project or solution using MSBuild.' marked build as failure
Finished: FAILURE
------------------
Many Thanks
this line:
The command prompt has been disabled by your administrator indicates that you are not allowed to launch batch instructions on your server.

Resources