Cruisecontrol.net nant results different from non-cc.net - cruisecontrol.net

I've a nant script that builds a VS2008 solution. When I run it myself by typing 'nant' in the command line all the correct DLLs are copied to the respective bin directories. But when Cruisecontrol performs the CI build no DLLs are copied to the bin directories.
Any ideas what's causing this?

Your problem, dear Mr. Flibble, is that you have specified "test" as the target in the cc.net config which is overrigind the default target (build) that gets executed when executing nant from the commandline.

Very probably there is something in your environment not in the Cruise Control environment. Add something in the CruiseControl build (like setting verbose on nant) and confirm you have the same paths set up.

Related

Calling groovy execute cross platform

I am currently using gmaven plus to run a groovy command inside maven.
The command (for the sake of example) would be
git help
If I run it on linux I can do:
'git help'.execute().text.trim()
This however doesn't work on windows. Instead I need to do:
'cmd /C git help'.execute().text.trim()
Is there a cross platform way of doing this?
Seeing that it worked for others got me thinking and indeed the problem was with my own PATH configuration;
Apparently, if you define git in the path as follows:
"C:\Program Files (x86)\Git\bin"
then when running from command it will find git. However, groovy will NOT find it.
On the other hand, if you define git in the path as follows:
C:\Program Files (x86)\Git\bin
i.e. without the "". Then everything works fine.
see also https://serverfault.com/questions/349179/path-variable-and-quotation-marks-windows

Jenkins build Visual Studio Solution with Different Configuration

Hi I have a visual studio solution which has been configured in Jenkins. And it's building successfully in debug configuration. How ever I need to change the build configuration to Release or another different one.
So How can I configure Jenkins to select the configuration to build?
If you are using the MSBuild plugin, try adding the configuration flag on the "Command Line Arguments" section:
/p:Configuration=Release
If you are simply building from command line script (batch, powershell, etc), add the above flag there..
What I do, is create a generic job for build process which receives a parameter called "BUILD_CONFIGURATION" from the parent job which triggers it.
And I then reference it in the flag as a variable:
/p:Configuration=${BUILD_CONFIGURATION}

Jenkins tfs plug-in and checkout source on remote node

First, I'm a Jenkins neophyte. I have made a free-style software project in Jenkins to perform my Linux build. The Jenkins server is running on Windows so there are slave nodes configured for doing this Linux build. The sources are kept in a TFS server.
I updated our TFS plugin to the latest of 4.0.0. This plugin says that it is no longer necessary for slave nodes to have the Team Explorer Everywhere package installed as it uses the Java API. However, when I kick off my build, I get this:
Started by user Andy Falanga (afalanga)
[EnvInject] - Loading node environment variables.
Building remotely on dmdevlnx64-01 (PY27-64 CENTOS6-64 LOG4CPLUS PY26-64) in workspace /home/builder/jenkins/workspace/Linux Autotools Build
Deleting project workspace... done
Querying for remote changeset at '$/Sources/Branches/Andy/AutotoolsMigration' as of 'D2015-10-05T18:26:27Z'...
Query result is: Changeset #4872 by 'WINNTDOM\afalanga' on '2015-09-25T23:36:24Z'.
Listing workspaces from http://ets-tfs:8080/tfs/SoftwareCollection...
... Long list of workspaces
Workspace Created by Team Build
Getting version 'C4872' to '/home/builder/jenkins/workspace/Linux Autotools Build'...
Finished getting version 'C4872'.
[Linux Autotools Build] $ /bin/bash /tmp/hudson7081873611439714406.sh
Bootstrapping autotools
/tmp/hudson7081873611439714406.sh: line 4: ./bootstrap: No such file or directory
Build step 'Execute shell' marked build as failure
Notifying upstream projects of job completion
Finished: FAILURE
I log into that system and look in the directory /home/builder/jenkins/workspace/Linux Autotools Build and sure enough, there's nothing there. My configuration is pretty simple.
I have discard old builds checked and a simple rotation (this is just me learning how to use it).
I have it set to "Restrict where the build is done" and a label which associates to the 3 slave nodes for doing this build.
All TFS credentials are input and correct.
No build triggers
A simple shell script for Build->Execute Shell which bootstraps the autotools and calls configure and then make.
What am I doing incorrectly?
I found the answer and am posting it here in case someone runs into this. This seems better than simply deleting the question. The TFS plugin doesn't seem to like spaces in the project name. The name before Linux Autotools Build which didn't work and the name now, LinuxAutotoolsBuild which does.
The errors provided by the Jenkins system didn't provide enough information for this to be apparent. After trying a few other things the thought occurred, "Perhaps the spaces are causing grief."
Hope this helps someone.

Jenkins to SCP a few folders and files from SVN to linux server?

I use jenkins to do auto deployment weekly to a tomcat server, and it is fairly simple to do using the "curl" with the tomcat manager. and since i am only uploading a .war file, so its very straight forward.
But when comes to a backend console application, Anyone has any idea how to use jenkins to upload an entire "set of folders with files" onto a linux box? The project that i have is built via ant and has all the folder inside the SVN.
A couple things come to mind.
Probably the most straightforward thing to do is use the ant scp task to push the directory / directories up to the server. You'll need the jsch jar on your Ant classpath to make it work, but that's not too bad to deal with. See the Ant docs for the scp task here. If you want to keep your main build script clean, just make another build script that Jenkins can run named 'deploy.xml' or similar. This has the added benefit that you can use it from places other than Jenkins.
Another idea is to check them out directly on the server from SVN. Again, ant can probably help you with this if you use the sshexec task, and run the subversion task inside of that. SSHexec docs here
Finally, Jenkins has a "Publish Over SSH" plugin you might try out. I've not used it personally, but it looks promising! Right over here!

How can I get Unit Tests to run against the appropriate DLL when the DLL cannot be referenced in the project?

I've got the following "Pre Build Event" working for my powershell builds (including our Continuous Integration). It simply moves a DLL into the output directory based on the Processor Architecture.
if '$(PROCESSOR_ARCHITECTURE)'=='AMD64' (copy /y "$(ProjectDir)x64\sqlite3.dll" "$(OutDir)")
if '$(PROCESSOR_ARCHITECTURE)'=='x86' (copy /y "$(ProjectDir)x86\sqlite3.dll" "$(OutDir)")
if '$(PROCESSOR_ARCHITEW6432)'=='AMD64' (copy /y "$(ProjectDir)x64\sqlite3.dll" "$(OutDir)")
The problem I'm running into is when I run the Resharper Unit Tests within the IDE. When I do this, the Pre Build event doesn't run, and therefore all of the tests that depend on the sqlite3.dll fail.
What I need to do is either be able to move the appropriate file into the output directory before the Test Runner runs, OR make sure the Test Runner runs against ONLY the x86 Architecture, whereby I can just drop the appropriate file in the bin\debug folder and be done with it.
Things I've tried:
I've tried setting the "Build Settings" to "Always Build" but this has no affect on the outcome. It appears as though the build in the IDE doesn't run the Pre Build Event
I've also tried to set the default platform architecture in [Resharper -> Options -> Tools -> Unit Testing] - as per the docs, but unfortunately my version of R# doesn't have that option (7.1.3)
You can force the C# project to be 32 bit only, and the ReSharper runner will only run it as 32 bit. That way, you can drop the x86 dll in the bin\debug folder and it should all just work.

Resources