CruiseControl unable to recognize modifications for Mercurial repository - mercurial

I am trying to implement a continuous build stack, and decided to use CruiseControl with Ant. However, it seems that CruiseControl is having problem picking up the changes from my Mercurial directory. Here's some code from config.xml with a bunch of unnecessary elements taken out. One workaround I found was to set requiremodification to false, which will build the software regardless of the changes made. Am I missing something here? Or is this a bug of CruiseControl.
<!--config.xml-->
<project name="test_runner" buildafterfailed="false"
requiremodification="true" forceonly="${test_runner.inactive}">
<listeners>
<currentbuildstatuslistener file="${projectLogsDir}/status.txt" />
</listeners>
<bootstrappers>
</bootstrappers>
<modificationset quietperiod="${quietPeriod}">
<mercurial localworkingcopy="${mercurialDir}/solution1" property="solution1_changed" />
</modificationset>
<schedule interval="${scheduleInterval}">
<ant liveOutput="true" />
</schedule>
</project>

In CruiseControl.Net the server logs which command it performs to check for changes. You can check if this command is correct by running it yourself on the command line. I had the same issue with Perforce, and by running the command myself I found out that I had configured an incorrect view.
Note that I'm much more familiar with CruiseControl.Net than CruiseControl, so this might not apply to CruiseControl.

Related

Monodevelop fails to build, can't find Microsoft.DiaSymReader.Native.x86.dll'

I am trying to build a web api project using monodevelop on a mac. The thing is that after a few hiccups (explained in a question that turned out to be so messy I have just deleted) I get to the point of getting this error
/Users/myuser/git/LiveData/LiveData/CSC: Error CS0041: Unexpected error writing debug information -- 'Windows PDB writer is not available -- could not find Microsoft.DiaSymReader.Native.x86.dll' (CS0041) (LiveData)
In a windows machine the same project builds using visual studio targeting mono 4.5.
When I click on the error it tells me that /Users/myuser/git/LiveData/LiveData/CSC doesn't exist
Another thing is that in the folder structure of the solution there's a package folder (not the one inside the project) and inside this one I have a folder called Microsoft.Net.Compilers 1.3.2 that has inside another folder called "tools" that contains among other things csc.exe and the dll thta can't be found.
I have tried to install the dll directly in the project using nuget but even if it was installed the build showed me the same error
Thanks,
As for workaround for now you can just limit usage of Microsoft.Net.Compilers to Release configuration (edit *.csproj file):
<Import Project="..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props" Condition="'$(Configuration)' == 'Release' And Exists('..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props')" />
take a look at beginning of condition:
'$(Configuration)' == 'Release'
This way I can build and debug locally and build my project ie. in appharbor.
Building the project in release configuration should fix it!
This might not be completely related but may be helpful in some ways. Regarding the issue on 'could not find Microsoft.DiaSymReader.Native.x86.dll', have a look at this issue on GitHub: https://github.com/dotnet/cli/issues/3016
It seems like the solution is either:
Dependency to Microsoft.NETCore.Platforms needed for RID graph which
was missing. Any package which has transitive dependency on it (like
NETStandard.Library) could also make things work.
Adding dependency to "Microsoft.NETCore.Platforms": "1.0.1-" or
"NETStandard.Library":"1.5.0-" make it work.
adding Microsoft.NETCore.Platforms works as well

Msbuild running in Jenkins target calling HgPull fails with HgProcessException: The command <hg.exe> is not available

I am porting over an MSBuild script from CCnet to run in Jenkins. The MSBuild project is used to create a deployment package. I would rather have Jenkins drive this process itself but that's a longer term aim.
The problem i am having is (as in the title) when we try and use the HgPull target, from the MSBuild mecurial task (http://msbuildhg.codeplex.com/) we get the error message
HgProcessException: The command hg.exe is not available [Path to project]
I have seen on the project web site that someone solved it by adding the LibraryLocation proeprty to the target but that seems to have made no difference. My target currently looks like this:
Target Name="UpdateSources">
<HgPull
LibraryLocation="C:\Program Files\TortoiseHg\hg.exe"
Force="true"
Update="true"
LocalPath="$(SourcePath)"
/>
<HgUpdate
LibraryLocation="C:\Program Files\TortoiseHg\hg.exe"
Clean="true"
LocalPath="$(SourcePath)"
/>
I'm rather at a loss. Please let me know if you need any more information added to this post to solve this issue. I'm really quite new to MSBuild so really not sure where to start investigating this.
EDIT:
One thing i forgot to mention was that i have tried running the MSbuild command in a console window on the build server and still get the same result. This is really odd given it works fine in CCNet, what magic is CCNet doing to make this command work?
This is now resolved, unfortunately i'm not sure what changes i made to correct these. I believe it may have been down to path separators and whether they where trailing or not in another part of the config file. It does so annoy me with the lack of resilience/consistency between applications where you need to specify paths with/without trailing slashes.
Just a thought, but try adding 'C:\Program Files\TortoiseHg' to your system path. Maybe CCNet has it specified somewhere that Jenkins doesn't have access to.
Also, just for sanity's sake, verify that hg.exe actually exists at that location.

Azure Worker Role configuration issue while using SlowCheetah with custom config

We are using Nlog as logging tool with our Worker Role of Azure app.
It requires NLog.config file. We installed "SlowCheetah - XML Transforms", and have two Debug/Release transforms).
Solution does get rebuild successfully.
But when I try to run, I am getting following error. (I used exact transformation for nolog.config in one of my Windows service app, and it is working fine there).
Error 163 The item "bin\Debug\NLog.config" in item list "OutputGroups"
does not define a value for metadata "TargetPath". In order to use
this metadata, either qualify it by specifying
%(OutputGroups.TargetPath), or ensure that all items in this list
define a value for this metadata. C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure
Tools\1.6\Microsoft.WindowsAzure.targets 2299 5 Insight.CloudWeb
I don't know if this is done by the SlowCheetah extension, but could you verify if your *.csproj file contains the AfterCompile target similar to this?
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<UsingTask TaskName="TransformXml"
AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
<Target Name="AfterCompile" Condition="exists(’app.$(Configuration).config’)">
<TransformXml Source="NLog.config"
Destination="$(IntermediateOutputPath)$(TargetFileName).config"
Transform="NLog.$(Configuration).config" />
<ItemGroup>
<AppConfigWithTargetPath Remove="NLog.config"/>
<AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config">
<TargetPath>$(TargetFileName).config</TargetPath>
</AppConfigWithTargetPath>
</ItemGroup>
</Target>
Take a look at Oleg's blog post .Config File Transformation under App.config File Transformation for more information.
I have a fix for this. Now you should be able to transform app.config as well as other XML files for Azure Worker Roles using SlowCheetah. Once I get the fix verified I will release the update to the VS gallery.
If you would like to try the fix you can download the updated VSIX at https://dl.dropbox.com/u/40134810/SlowCheetah/issue-44/SlowCheetah-issue-44.zip. If you are interested in following up on this please use the issue #44.

Converting CruiseControl from CVS to Mercurial

We have an existing cc configuration that was setup by someone before I got here.
We've converted our repository from cvs to mercurial stored on bitbucket.
Everything in my question below is basically just wondering, where do I point to the bitbucket repository in my setup to check for changes? And information about my specific setup.
Looking at how the cvs projects were set up, we have a config.xml and a projectbuild.xml file that contain information about the repository.
I've found the documentation for tag options for the config.xml here :
http://cruisecontrol.sourceforge.net/main/configxml.html
but I'm not sure where I can actually look at the bitbucket repository to check for changes. I assume this would be in the projectbuild.xml file, but I'm not sure what the tag options would be for mercurial. I'm more than happy to be pointed toward some documentation, all I've been able to find is stuff on the config.xml.
Here is part of my config.xml and my projectbuild, or build-tnl-default.xml file as it's called for my specific case:
config.xml (Notice I don't have bootstrappers in this file, I've seen this in other examples and am not sure if this would help me.
<modificationset quietperiod="900">
<mercurial localworkingcopy="projects/${project.name}">
</modificationset>
<schedule interval="100">
<ant anthome="C:\usr\local\apache-ant"
antworkingdir="projects/${project.name}"
buildfile="build-tnl-default.xml"
uselogger="true"
usedebug="false"
propertyfile="C:\usr\local\ia\build.properties"/>
</schedule>
build-tnl-default.xml:
<project name="build-tnl-default"
default="build">
<target name="build">
<!-- Get the latest from mercurial -->
<mercurial>
<!-- Call the target that does everything -->
<ant antfile="build.xml" dir="tnl" target="all"/>
</target>
</project>
Here I have no idea what options are available to me in the mercurial tag. I assume I just need to point this to the repository on bitbucket? In the previous version, it looked like this was pointing to the cvs repository here. I'm just not sure what the mercurial attributes are.
I'm sorry about my newness with this stuff, I might require a little more explanation than many other users. Any help is appreciated. Thanks
You check for updates in your repository (regardless whereever it is hosted) via
<modificationset quietperiod="900">
<mercurial localworkingcopy="projects/${project.name}">
</modificationset>
These tags say, that you query the repository you've checked out under projects/${project.name} and that a build is triggered if within a time frame of 15 minutes (900 seconds) no further changes occured. (I think that 15 minutes is a bit much, btw)
Simply make sure that projects/${project.name} is a Mercurial project that was checked out via hg clone http://repositoryAtBitbucketAsAnExample projects/${project.name} (make sure to expand ${project.name}).
I did not fully understand what build-tnl-default.xml is supposed to do, but if it should grab the newest build.xml, you should think about doing it with an Execootstrapper running something like hg pull ${path.to}/build.xml.
I have no idea what options are available to me in the mercurial tag.
You should determine the <taskdef .../> is used that loads the mercurial tag. This should be somewhere in build-tnl-default.xml or a file that is imported by it.

Do you have additional examples of executing MySql with Wix?

I'm still working on my Wix installer that includes replacing some MySql commands.
Specifically, I want the installer to run a script that creates a user, and then using that user, I want the installer to run a script that creates a database and creates tables. (It seems that an installer should be able to do this.)
I posted earlier about the user, and haven't been able to figure that out yet.
So skipping that for a moment, let's assume that my user exists. This user happens to not have a password. Without the installer, the command I usually do to run my script that creates the database and tables is:
mysql --user=myname < thisismyscript.sql
This works fine - so I know my script works.
Two problems I see in the Wix, and I'm hoping someone can either explain, or post additional examples (I learn best by seeing others examples).
1) seems to be the lack of a password.
In the .wxs file, I have:
<util:User Id='SQLUser' Name='[SQLUSER]' />
<Component Id='SqlComponent' Guid='7B524167-D8CF-465E-AEE8-6B70CF712A3A' KeyPath='yes'>
<sql:SqlDatabase Id='SqlDatabase' Database='adatabase' User='SQLUser' Server='[SQLSERVER]'
CreateOnInstall='yes' DropOnUninstall='yes' ContinueOnError='yes'>
<sql:SqlScript Id='mynewdb' BinaryKey='mynewdb' ExecuteOnInstall='yes' />
</sql:SqlDatabase>
</Component>
<Binary Id='mynewdb' SourceFile='thisismyscript.sql' />
<Property Id='SQLUSER'>myname</Property>
<Property Id='SQLSERVER'>localhost</Property>
(this is all embeded in the right places in the .wxs file and the file compiles fine... it's just when I run the .msi, my database has not been created.)
The only way I was able to leave the password property blank was to add that Admin tag. I'm not sure what to do here.
The second problem is that within the SQLComponent, I had to write down a database name, but of course, this database doesn't actually exist yet. Is this a problem? (I also tried creating the database manually, so that when the .msi ran it would already be there... but then nothing else happened)
I also ran msiexec with logging, and it appears that my sql script executes... there are no errors that I can see in the log.
Help? This really seems like something an installer should be able to do... and that I'm just doing something wrong...
Thanks in advance!
-Adeena
Neither WiX nor MSI has native support for MySQL. InstallShield has MySQL support.