Good day folks,
I have just set up CC for the first time. It is "sort of" working, but
there are a number of problems. Here is issue #1
CC here does little because most of the work is being done by rake/
albacore/msbuild/nunit via the rake build script.
1) CC gets an Incomprehensible error message from rake. See Appendix
1.
I'm getting this status message back:
<message level="Error">mkdir -p D:/Builds/MyProjects/Publish</
message>
corresponding to this rake line:
mkdir_p PUBLISH_DIR
The build succeeds. I tested whether this error actually happens by
placing a test.txt inside D:\Builds\MyProjects\Publish. After the
build the test.txt was missing, which indicates that the Remove
Directory (RD) command and subsequent make directory commands worked.
Following on from that login, I checked whether the published websites
has been put inside D:\Builds\MyProjects\Publish. Yes they had. So if
the remove directory and make directory commands worked, why am I
getting an error message? [PS: See the rake build script: Appendix 2]
The line
mkdir_p PUBLISH_DIR
is being correctly executed and is valid ruby/rake, so why the error?
Furthermore, the character: - represents a hyphen, not an
underscore. So, please, can anyone explain this?
PS 2: I guess this was the message notified to CC.NET by the rake
script.
Appendix 1
----------
[MyProjects:INFO] Task error:
<buildresults>
<message level="Error">rd D:\Builds\MyProjects\Publish /S/Q</
message>
<message level="Error">mkdir -p D:/Builds/MyProjects/Publish</
message>
<message level="Error">mkdir -p D:/Builds/MyProjects/Publish/
Admin/</message>
<message level="Error">mkdir -p D:/Builds/MyProjects/Publish/
Client/</message>
<message level="Error">svn update D:/Builds/MyProjects/Source</
message>
</buildresults>
[MyProjects:INFO] Merging file 'D:\Builds\MyProjects\Reports\Test-
Result.xml'
[MyProjects:INFO] Integration complete: Success - 20/02/2012 10:00:35
Appendix 2
----------
DRIVE = ENV["drive"] || 'D'
Websites = [ :Admin, :Client ]
PROJECT = 'MyProjects'
ROOT = "#{DRIVE}:/Builds"
PROJECT_DIR = "#{ROOT}/#{PROJECT}"
PUBLISH_DIR = "#{PROJECT_DIR}/Publish"
def removeDirectory dir
if Dir.exists? dir
dir2 = dir.gsub("/", "\\" )
sh "rd #{dir2} /S/Q" # Remove it, forcing it when not-empty
end
end
desc 'Remove existing directories, build new ones'
task :clean do
removeDirectory PUBLISH_DIR
mkdir_p PUBLISH_DIR
Websites.each { |site| mkdir_p "#{PUBLISH_DIR}/#{site}/" }
end
Thank you folks
That was #1, now for more serious stuff.