Jenkins - Cannot proceed with MSBuild - jenkins

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.

Related

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 MSBUILD : error MSB1008: Only one project can be specified.Switch: Files

I know there are many threads with same subject line ,but i am not getting any answer and hence putting my question here.
I am new to this and try to learn as fast as possible due to the time lines i have.
I did Jenkin setup (tried my best to do correctly in first shot)
But when ever i try to build i got following error
Started by user User 1
Building in workspace C:\Program Files (x86)\Jenkins\workspace********Service
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Done
Querying for remote changeset at '$/Reference Data Master/Development/Source/*******DataSrvices' as of 'D2017-08-24T07:21:11Z'...
Query result is: Changeset #109084 by 'user' on '2017-08-23T13:04:44Z'.
Checking if there exists a mapping for E:\MyDrive\Jenkins\workspace...yes, in workspace 'Hudson-*****Service-MASTER'.
Downloading list of workspaces from http://********:8080/tfs...
Getting version 'C109084' to 'E:\MyDrive\Jenkins\workspace'...
Finished getting version 'C109084'. Retrieved 0 resources.
Path To MSBuild.exe: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
Executing the command cmd.exe /C " chcp 1252 && C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe %workspace%\DataService.Windows\DataSrvices.sln " && exit %%ERRORLEVEL%% from C:\Program Files (x86)\Jenkins\workspace\WindowsService
[WindowsService] $ cmd.exe /C " chcp 1252 && C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe %workspace%\DataService.Windows\DataSrvices.sln " && exit %%ERRORLEVEL%%
Active code page: 1252
Microsoft (R) Build Engine version 4.0.30319.34209
[Microsoft .NET Framework, version 4.0.30319.34209]
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1008: Only one project can be specified.
Switch: Files
For switch syntax, type "MSBuild /help"
Build step 'Build a Visual Studio project or solution using MSBuild' marked build as failure
Finished: FAILURE
Please find the setup i did for my first JOB in jenkins
Source COde managment : Done it for TFS
Build Trigger
Use the MSBuild plugin, and simply build your complete solution. The example in this screen shot even runs your code analysis if you like.

command not found when executed from jenkins, but runs on mac agent

I have Jenkins set up on a Windows machine, with a mac slave configured.
When I run the command nuget directly from terminal, it works. However when I try running the nuget command from Jenkins as a executable shell, I get command not found
[iOS Build] $ /bin/sh -xe /var/folders/hr/b_p9skp53178b45895w2htw80000gn/T/hudson278562289764277217.sh
+ nuget restore '/Users/a/Jenkins/workspace/iOS Build/App/Acquaint.Native.sln'
/var/folders/hr/b_p9skp53178b45895w2htw80000gn/T/hudson278562289764277217.sh: line 2: nuget: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
I already have the directory where nuget resides configured in the PATH environment variable
maybe:
echo $PATH within your job to ensure it's configured as you expect when the job runs.
try including the full path to nuget. run /usr/local/bin/nuget restore... (or wherever nuget is found) instead of nuget restore... to determine if it's really a PATH issue.

codewarrior IDE is not responding back when build runs from jenkins

I m trying to build a project from codewarrior IDE command line. It works fine when i run it manually on the windows slave as:
CmdIDE.exe C:\Jenkins\build\workspace\project_name\xxxxxxxx.mcp /b /c /q
But when i try to run the build from Jenkins nothing happens and it keeps on running. I tried to do this from a batch script using psexec but still no response. Please help if anyone has done this from jenkins.
C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.3\bin>CmdIDE.exe 'C:\project_name\xxxxxxxx.mcp' /b /c /q
Freescale CodeWarrior IDE. Hit /? for help ERROR: Process Aborted. (Code 9)
C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.3\bin>exit 9 Build step 'Execute Windows batch command' marked build as failure
Thanks in advance

devenv.exe execute through jenkin's job doesn't work

i am trying to execute devenv.exe through windows batch command plugin in Jenkins
but it keeps on executing and fails to launch the application.
Console Output :
**In progressConsole Output
Started by user anonymous
Building on master in workspace C:\Program Files (x86)\Jenkins\jobs\TEMP\workspace
[workspace] $ cmd /c call C:\Windows\TEMP\hudson3900292017086958332.bat
C:\Program Files (x86)\Jenkins\jobs\TEMP\workspace>set DEVPATH=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
C:\Program Files (x86)\Jenkins\jobs\TEMP\workspace>set PATH=D:\app\nazopay\product\11.2.0\dbhome_1\bin;D:\app\nazopay\product\11.2.0\client_1;C:\Program Files (x86)\Integrity\IntegrityClient10\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\cde\tools;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.6.0_23\bin\;C:\Program Files (x86)\Google\Chrome\Application;C:\MingW;C:\PROGRA~2\INTEGR~1\Toolkit\mksnt;%JAVA_HOME%;,;C:\Program Files\Java\jdk1.6.0_23;,;C:\Program Files\Java\jdk1.6.0_23\bin;%CLASS_PATH%;,;C:\Program Files\Java\jdk1.6.0_23\lib;,;C:\Program Files\Java\jdk1.6.0_23\lib;;C:\Program Files (x86)\M**icrosoft Visual Studio 10.0\Common7\IDE
C:\Program Files (x86)\Jenkins\jobs\TEMP\workspace>devenv.exe
You must execute devenv.com.
The devenv.exe always attempts to open GUI, even when commands are given, and it can't. The devenv.com has output directed to standard output and works fine from Jenkins.
You also must pass arguments.
Without arguments both devenv.com and devenv.exe just start the IDE GUI, which is not what you want. The correct command-line is
devenv.com projectname.sln /Build Release /Project projectname
First is path to the solution you want to build. Then the /Build flag is followed by configuration. If you have multiple platforms, you have to pass configuration and platform combination, e.g. Release|Win32. The /Project flag names project to build (including all dependencies). If omitted, it builds all projects selected for build in given configuration.
Why don't you use msbuild?
This would be a good starting point for your windows build script:
call "%VS100COMNTOOLS%\vsvars32.bat"
msbuild projectname.sln /target:Rebuild /l:FileLogger,Microsoft.Build.Engine;logfile=msbuild.log || goto error
goto end
:error
#echo ERROR: Build failed
exit/b 1
:end
exit/b 0
This way you can also capture the output log that you can parse with one of the jenkins plugins.
Ofcourse, adjust the VS100COMNTOOLS to your version of MSVS

Resources