/[Slicer4]/tags/Slicer-3-6-RC2/Scripts/getbuildtest.tcl
ViewVC logotype

Contents of /tags/Slicer-3-6-RC2/Scripts/getbuildtest.tcl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 13446 - (show annotations) (download) (as text)
Fri May 21 21:45:30 2010 UTC (7 years, 5 months ago) by hayes
File MIME type: application/x-tcl
File size: 21835 byte(s)
ENH: Changed filename to RC2
1 #!/bin/sh
2 # the next line restarts using tclsh \
3 exec tclsh "$0" "$@"
4
5 ################################################################################
6 #
7 # getbuildtest.tcl
8 #
9 # does an update and a clean build of slicer3 (including utilities and libs)
10 # then does a dashboard submission
11 #
12 # Usage:
13 # getbuildtest [options] [target]
14 #
15 # Initiated - sp - 2006-05-11
16 #
17
18 ################################################################################
19 #
20 # simple command line argument parsing
21 #
22
23 proc Usage { {msg ""} } {
24 global SLICER
25
26 set msg "$msg\nusage: getbuildtest \[options\] \[target\]"
27 set msg "$msg\n \[target\] is determined automatically if not specified"
28 set msg "$msg\n \[options\] is one of the following:"
29 set msg "$msg\n h --help : prints this message and exits"
30 set msg "$msg\n -f --clean : delete lib and build directories first"
31 set msg "$msg\n -t --test-type : CTest test target (default: Experimental)"
32 set msg "$msg\n --release : compile with optimization flags"
33 set msg "$msg\n --relwithdebinfo : compile with optimization flags and debugging symbols"
34 set msg "$msg\n -u --update : does a cvs/svn update on each lib"
35 set msg "$msg\n --no-slicer-update : don't update slicer source (does not effect libs)"
36 set msg "$msg\n --build-dir : override default build directory"
37 set msg "$msg\n --doc-dir : override default documentation directory"
38 set msg "$msg\n --version-patch : set the patch string for the build (used by installer)"
39 set msg "$msg\n : default: version-patch is the current date"
40 set msg "$msg\n --tag : same as version-patch"
41 set msg "$msg\n --pack : run cpack after building (default: off)"
42 set msg "$msg\n --upload : set the upload string for the binary, used if pack is true"
43 set msg "$msg\n : snapshot (default), nightly, release"
44 set msg "$msg\n --doxy : just do an svn update on Slicer3 and run doxygen"
45 set msg "$msg\n --verbose : optional, print out lots of stuff, for debugging"
46 set msg "$msg\n --rpm : optional, specify CPack RPM generator for packaging"
47 set msg "$msg\n --deb : optional, specify CPack DEB generator for packaging"
48 set msg "$msg\n -e --extend : optional, build external modules using the extend script"
49 set msg "$msg\n -32 -64 : Set if we want to build Slicer 32 or 64 bits"
50 set msg "$msg\n : The default on Solaris is the current bitness of the underlying kernel (isainfo -b)"
51 set msg "$msg\n : The default on Linux is the current bitness of the underlying kernel"
52 set msg "$msg\n : 32 bits on other platforms"
53 set msg "$msg\n --gcc --suncc : Set the desired compiler for the build process"
54 set msg "$msg\n : The default is gcc/g++"
55 puts stderr $msg
56 }
57
58 set ::GETBUILDTEST(clean) "false"
59 set ::GETBUILDTEST(update) ""
60 set ::GETBUILDTEST(no-slicer-update) ""
61 set ::GETBUILDTEST(build-dir) ""
62 set ::GETBUILDTEST(doc-dir) ""
63 set ::GETBUILDTEST(release) ""
64 set ::GETBUILDTEST(test-type) "Experimental"
65 set ::GETBUILDTEST(version-patch) ""
66 set ::GETBUILDTEST(pack) "false"
67 set ::GETBUILDTEST(upload) "false"
68 set ::GETBUILDTEST(uploadFlag) "nightly"
69 set ::GETBUILDTEST(doxy) "false"
70 set ::GETBUILDTEST(verbose) "false"
71 set ::GETBUILDTEST(buildList) ""
72 set ::GETBUILDTEST(cpack-generator) ""
73 set ::GETBUILDTEST(rpm-spec) ""
74 set ::GETBUILDTEST(extend) "false"
75 set ::GETBUILDTEST(compiler) ""
76 set ::GETBUILDTEST(bitness) "32"
77 switch $::tcl_platform(os) {
78 "SunOS" {
79 set isainfo [exec isainfo -b]
80 set ::GETBUILDTEST(bitness) "$isainfo"
81 set ::GETBUILDTEST(compiler) "gcc"
82 }
83 "Linux" {
84 if {$::tcl_platform(machine) == "x86_64"} {
85 set ::GETBUILDTEST(bitness) 64
86 }
87 }
88 }
89
90 set strippedargs ""
91 set argc [llength $argv]
92 for {set i 0} {$i < $argc} {incr i} {
93 set a [lindex $argv $i]
94 switch -glob -- $a {
95 "--clean" -
96 "-f" {
97 set ::GETBUILDTEST(clean) "true"
98 }
99 "--update" -
100 "-u" {
101 set ::GETBUILDTEST(update) "--update"
102 }
103 "--no-slicer-update" {
104 set ::GETBUILDTEST(no-slicer-update) "--no-slicer-update"
105 }
106 "--release" {
107 set ::GETBUILDTEST(release) "--release"
108 set ::VTK_BUILD_TYPE "Release"
109 }
110 "--relwithdebinfo" {
111 set ::GETBUILDTEST(release) "--relwithdebinfo"
112 set ::VTK_BUILD_TYPE "RelWithDebInfo"
113 }
114 "--build-dir" {
115 incr i
116 if { $i == $argc } {
117 Usage "Missing build-dir argument"
118 } else {
119 set ::GETBUILDTEST(build-dir) [lindex $argv $i]
120 }
121 }
122 "--doc-dir" {
123 incr i
124 if { $i == $argc } {
125 Usage "Missing doc-dir argument"
126 } else {
127 set ::GETBUILDTEST(doc-dir) [lindex $argv $i]
128 }
129 }
130 "-t" -
131 "--test-type" {
132 incr i
133 if { $i == $argc } {
134 Usage "Missing test-type argument"
135 } else {
136 set ::GETBUILDTEST(test-type) [lindex $argv $i]
137 }
138 }
139 "--tag" -
140 "--version-patch" {
141 incr i
142 if { $i == $argc } {
143 Usage "Missing version-patch argument"
144 } else {
145 set ::GETBUILDTEST(version-patch) [lindex $argv $i]
146 }
147 }
148 "--pack" {
149 set ::GETBUILDTEST(pack) "true"
150 }
151 "--upload" {
152 set ::GETBUILDTEST(upload) "true"
153 incr i
154 if {$i == $argc} {
155 # uses default value
156 } else {
157 # peek at the next arg to see if we should use it...
158 set arg [lindex $argv $i]
159 if { [string match "--*" $arg] } {
160 # next arg is another -- flag, so don't use it as the
161 # upload flag...
162 incr i -1
163 } else {
164 set ::GETBUILDTEST(uploadFlag) [lindex $argv $i]
165 }
166 }
167 }
168 "--doxy" {
169 set ::GETBUILDTEST(doxy) "true"
170 }
171 "--verbose" {
172 set ::GETBUILDTEST(verbose) "true"
173 }
174 "--rpm" {
175 set ::GETBUILDTEST(cpack-generator) "RPM"
176 }
177 "--deb" {
178 set ::GETBUILDTEST(cpack-generator) "DEB"
179 }
180 "--extend" -
181 "-e" {
182 set ::GETBUILDTEST(extend) "true"
183 }
184 "-64" {
185 set ::GETBUILDTEST(bitness) "64"
186 }
187 "-32" {
188 set ::GETBUILDTEST(bitness) "32"
189 }
190 "--suncc" {
191 set ::GETBUILDTEST(compiler) "suncc"
192 }
193 "--gcc" {
194 set ::GETBUILDTEST(compiler) "gcc"
195 }
196 "--help" -
197 "-h" {
198 Usage
199 exit 1
200 }
201 "-*" {
202 Usage "unknown option $a\n"
203 exit 1
204 }
205 default {
206 lappend strippedargs $a
207 }
208 }
209 }
210
211 set argv $strippedargs
212 set argc [llength $argv]
213
214 if {$argc > 1 } {
215 # Usage
216 # exit 1
217 }
218 # puts "getbuildtest: setting build list to $strippedargs"
219 set ::GETBUILDTEST(buildList) $strippedargs
220
221
222
223 ################################################################################
224 #
225 # Utilities:
226
227 proc runcmd {args} {
228 global isWindows
229 puts "running: $args"
230
231 # print the results line by line to provide feedback during long builds
232 # interleaves the results of stdout and stderr, except on Windows
233 if { $isWindows } {
234 # Windows does not provide native support for cat
235 set fp [open "| $args" "r"]
236 } else {
237 set fp [open "| $args |& cat" "r"]
238 }
239 while { ![eof $fp] } {
240 gets $fp line
241 puts $line
242 }
243 set ret [catch "close $fp" res]
244 if { $ret } {
245 puts stderr $res
246 if { $isWindows } {
247 # Does not work on Windows
248 } else {
249 error $ret
250 }
251 }
252 }
253
254
255 #initialize platform variables
256 foreach v { isSolaris isWindows isDarwin isLinux } { set $v 0 }
257 switch $tcl_platform(os) {
258 "SunOS" { set isSolaris 1 }
259 "Linux" { set isLinux 1 }
260 "Darwin" { set isDarwin 1 }
261 default { set isWindows 1 }
262 }
263
264 ################################################################################
265 # First, set up the directory
266 # - determine the location
267 # - determine the build
268 #
269
270 set cwd [pwd]
271 cd [file dirname [info script]]
272 cd ..
273 set ::Slicer3_HOME [pwd]
274 cd $cwd
275 if { $isWindows } {
276 set ::Slicer3_HOME [file attributes $::Slicer3_HOME -shortname]
277 }
278 if { $::GETBUILDTEST(build-dir) == ""} {
279 # use an enviornment variables so slicer-variables.tcl can see them
280 set ::env(Slicer3_LIB) $::Slicer3_HOME/../Slicer3-lib
281 set ::env(Slicer3_BUILD) $::Slicer3_HOME/../Slicer3-build
282 } else {
283 # use an enviornment variables so slicer-variables.tcl can see them
284 set ::env(Slicer3_LIB) $::GETBUILDTEST(build-dir)/Slicer3-lib
285 set ::env(Slicer3_BUILD) $::GETBUILDTEST(build-dir)/Slicer3-build
286 }
287
288 if { $::GETBUILDTEST(doc-dir) == ""} {
289 # check if there's an environment variable
290 if { [info exists ::env(Slicer3_DOC)] == 1 } {
291 set ::GETBUILDTEST(doc-dir) $::env(Slicer3_DOC)
292 } else {
293 # set an default value
294 set ::GETBUILDTEST(doc-dir) $::Slicer3_HOME/../Slicer3-doc
295 }
296 }
297 # set an environment variable so doxygen can use it
298 set ::env(Slicer3_DOC) $::GETBUILDTEST(doc-dir)
299
300
301 set Slicer3_LIB $::env(Slicer3_LIB)
302 set Slicer3_BUILD $::env(Slicer3_BUILD)
303
304 #######
305 #
306 # Note: the local vars file, slicer2/slicer_variables.tcl, overrides the default values in this script
307 # - use it to set your local environment and then your change won't
308 # be overwritten when this file is updated
309 #
310 set localvarsfile $Slicer3_HOME/slicer_variables.tcl
311 catch {set localvarsfile [file normalize $localvarsfile]}
312 if { [file exists $localvarsfile] } {
313 puts "Sourcing $localvarsfile"
314 source $localvarsfile
315 } else {
316 puts "stderr: $localvarsfile not found - use this file to set up your build"
317 exit 1
318 }
319
320 puts "making with $::MAKE"
321
322
323 #
324 # Deletes both Slicer3_LIB and Slicer3_BUILD if clean option given
325 #
326 # tcl file delete is broken on Darwin, so use rm -rf instead
327 if { $::GETBUILDTEST(clean) } {
328 puts "Deleting slicer lib files..."
329 if { $isDarwin } {
330 runcmd rm -rf $Slicer3_LIB
331 runcmd rm -rf $Slicer3_BUILD
332 if { [file exists $Slicer3_LIB/tcl/isPatched] } {
333 runcmd rm $Slicer3_LIB/tcl/isPatched
334 }
335
336 if { [file exists $Slicer3_LIB/tcl/isPatchedBLT] } {
337 runcmd rm $Slicer3_LIB/tcl/isPatchedBLT
338 }
339 } else {
340 file delete -force $Slicer3_LIB
341 file delete -force $Slicer3_BUILD
342 }
343 }
344
345 if { ![file exists $Slicer3_LIB] } {
346 file mkdir $Slicer3_LIB
347 }
348
349 if { ![file exists $Slicer3_BUILD] } {
350 file mkdir $Slicer3_BUILD
351 }
352
353 if { $::GETBUILDTEST(doxy) } {
354 if {[file exists $::env(Slicer3_DOC)] } {
355 # force removal of the old dir
356 puts "Clearing out old documentation directory $::env(Slicer3_DOC)"
357 file delete -force $::env(Slicer3_DOC)
358 }
359 if {![file exists $::env(Slicer3_DOC)] } {
360 puts "Making documentation directory $::env(Slicer3_DOC)"
361 file mkdir $::env(Slicer3_DOC)
362 }
363 }
364
365
366 ################################################################################
367 #
368 # the actual build and test commands
369 # - checkout the source code
370 # - make the prerequisite libs
371 # - cmake and build the program
372 # - run the tests
373 # - make a package
374 #
375
376
377 # svn checkout (does an update if it already exists)
378 if { $::GETBUILDTEST(test-type) != "Continuous" && $::GETBUILDTEST(no-slicer-update) == ""} {
379 cd $::Slicer3_HOME/..
380 if { [file exists Slicer3] } {
381 cd Slicer3
382 runcmd svn switch $::Slicer3_TAG
383 } else {
384 runcmd svn checkout $::Slicer3_TAG Slicer3
385 }
386 } else {
387 puts "Skipping update of Slicer3 (if a continuous test is select then Slicer3 source will be updated when the test starts)."
388 }
389
390 if { $::GETBUILDTEST(doxy) } {
391 # just run doxygen and exit
392 puts "Creating documenation files in $::env(Slicer3_DOC)"
393 set cmd "doxygen $::Slicer3_HOME/Doxyfile"
394 eval runcmd $cmd
395 return
396 }
397
398
399 # build the lib with options
400 cd $::Slicer3_HOME
401 set cmd "sh ./Scripts/genlib.tcl $Slicer3_LIB"
402
403 if { $::GETBUILDTEST(compiler) != "" } {
404 append cmd " --$::GETBUILDTEST(compiler)"
405 }
406 append cmd " -$::GETBUILDTEST(bitness)"
407
408 if { $::GETBUILDTEST(release) != "" } {
409 append cmd " $::GETBUILDTEST(release)"
410 }
411 if { $::GETBUILDTEST(update) != "" } {
412 append cmd " $::GETBUILDTEST(update)"
413 }
414 if { $::GETBUILDTEST(test-type) != "" } {
415 append cmd " --test-type $::GETBUILDTEST(test-type)"
416 }
417 if { $::GETBUILDTEST(buildList) != "" } {
418 # puts "Passing $::GETBUILDTEST(buildList) to genlib"
419 append cmd " $::GETBUILDTEST(buildList)"
420 }
421
422 set retval [catch "eval runcmd $cmd"]
423 if {$retval == 1} {
424 puts "ERROR: failed to run getbuildtest: $cmd"
425 return
426 }
427
428 if { $::GETBUILDTEST(version-patch) == "" } {
429 # TODO: add build type (win32, etc) here...
430 set ::GETBUILDTEST(version-patch) [clock format [clock seconds] -format %Y-%m-%d]
431 }
432
433 # set the binary filename root
434 set ::GETBUILDTEST(binary-filename) "Slicer3-3.6-RC2-$::GETBUILDTEST(version-patch)-$::env(BUILD)"
435 if {$::GETBUILDTEST(verbose)} {
436 puts "CPack will use $::::GETBUILDTEST(binary-filename)"
437 }
438
439 # set the cpack generator to determine the binary file extension
440 if {$isLinux || $isDarwin} {
441 if { $::GETBUILDTEST(cpack-generator) == "" } {
442 # default generator is TGZ"
443 set ::GETBUILDTEST(cpack-generator) "TGZ"
444 set ::GETBUILDTEST(cpack-extension) ".tar.gz"
445 # if wish to have .sh, use generator = STGZ and extension = .sh / currently disabled due to Ubuntu bug
446 }
447 if {$::GETBUILDTEST(cpack-generator) == "RPM" || $::GETBUILDTEST(cpack-generator) == "DEB"} {
448 # RPMs cannot have dashes in the version names, so we use underscores instead
449 set ::GETBUILDTEST(version-patch) [clock format [clock seconds] -format %Y_%m_%d]
450 set ::GETBUILDTEST(rpm-spec) "%define __spec_install_post /bin/true"
451
452 if { $::GETBUILDTEST(cpack-generator) == "RPM" } {
453 set ::GETBUILDTEST(cpack-extension) ".rpm"
454 }
455 if { $::GETBUILDTEST(cpack-generator) == "DEB" } {
456 set ::GETBUILDTEST(cpack-extension) ".deb"
457 }
458 }
459 }
460 if {$isSolaris} {
461 set ::GETBUILDTEST(cpack-generator) "TGZ"
462 set ::GETBUILDTEST(cpack-extension) ".tar.gz"
463 }
464
465 if {$isWindows} {
466 set ::GETBUILDTEST(cpack-generator) "NSIS"
467 set ::GETBUILDTEST(cpack-extension) ".exe"
468 }
469
470 # once dmg packaging is done
471 if {0 && $isDarwin} {
472 set ::GETBUILDTEST(cpack-generator) "OSXX11"
473 set ::GETBUILDTEST(cpack-extension) ".dmg"
474 }
475
476 # make verbose makefiles?
477 if {$::GETBUILDTEST(verbose)} {
478 set ::GETBUILDTEST(cmake-verbose) "ON"
479 } else {
480 set ::GETBUILDTEST(cmake-verbose) "OFF"
481 }
482
483 # build the slicer
484 # - first run cmake
485 # - create the Slicer3Version.txt file
486 # - then run plaftorm specific build command
487
488 if { $::USE_SYSTEM_PYTHON } {
489 set ::Slicer3_USE_SYSTEM_PYTHON ON
490 } else {
491 set ::Slicer3_USE_SYSTEM_PYTHON OFF
492 }
493
494 cd $::Slicer3_BUILD
495 runcmd $::CMAKE \
496 -G$::GENERATOR \
497 -DMAKECOMMAND:STRING=$::MAKE \
498 -DCMAKE_CXX_COMPILER:STRING=$COMPILER_PATH/$COMPILER \
499 -DCMAKE_CXX_COMPILER_FULLPATH:FILEPATH=$COMPILER_PATH/$COMPILER \
500 -DITK_DIR:FILEPATH=$ITK_BINARY_PATH \
501 -DKWWidgets_DIR:FILEPATH=$Slicer3_LIB/KWWidgets-build \
502 -DOpenCV_DIR:FILEPATH=$Slicer3_LIB/OpenCV-build \
503 -DTeem_DIR:FILEPATH=$Slicer3_LIB/teem-build \
504 -DOpenIGTLink_DIR:FILEPATH=$Slicer3_LIB/OpenIGTLink-build \
505 -DBatchMake_DIR:FILEPATH=$Slicer3_LIB/BatchMake-build \
506 -DSlicer3_USE_BatchMake=OFF \
507 -DINCR_TCL_LIBRARY:FILEPATH=$::INCR_TCL_LIB \
508 -DINCR_TK_LIBRARY:FILEPATH=$::INCR_TK_LIB \
509 -DSlicer3_USE_PYTHON=$::USE_PYTHON \
510 -DSlicer3_USE_SYSTEM_PYTHON=$::Slicer3_USE_SYSTEM_PYTHON \
511 -DSlicer3_USE_NUMPY=$::USE_NUMPY \
512 -DSlicer3_USE_OPENIGTLINK=$::USE_OPENIGTLINK \
513 -DSlicer3_USE_OPENCV=$::USE_OPENCV \
514 -DPYTHON_INCLUDE_PATH:PATH=$::PYTHON_INCLUDE \
515 -DPYTHON_LIBRARY:FILEPATH=$::PYTHON_LIB \
516 -DSandBox_DIR:FILEPATH=$Slicer3_LIB/NAMICSandBox \
517 -DCMAKE_BUILD_TYPE=$::VTK_BUILD_TYPE \
518 -DSlicer3_VERSION_PATCH:STRING=$::GETBUILDTEST(version-patch) \
519 -DCPACK_GENERATOR:STRING=$::GETBUILDTEST(cpack-generator) \
520 -DCPACK_PACKAGE_FILE_NAME:STRING=$::GETBUILDTEST(binary-filename) \
521 -DCPACK_RPM_SPEC_MORE_DEFINE=$::GETBUILDTEST(rpm-spec) \
522 -DSLICERLIBCURL_DIR:FILEPATH=$Slicer3_LIB/cmcurl-build \
523 -DCMAKE_VERBOSE_MAKEFILE:BOOL=$::GETBUILDTEST(cmake-verbose) \
524 -DLAUNCHER_REPORT_VTK_ERRORS=$::LAUNCHER_REPORT_VTK_ERRORS \
525 $Slicer3_HOME
526
527
528 #
529 # run the versioner script to create the Slicer3Version.txt file
530 # that tells what slicer3 build these newly built extensions
531 # are compatibile with
532 #
533
534 set cmd "sh $::Slicer3_HOME/Scripts/versioner.tcl"
535 set retval [catch "eval runcmd $cmd" res]
536 if {$retval == 1} {
537 puts "ERROR: failed to run versioner script: $cmd"
538 puts "$res"
539 return
540 }
541
542 #
543 # now do the actual build
544 #
545
546 if { $isWindows } {
547
548 # TODO: this needs to be touched when upgrading python versions
549 # Here we put a copy of the python dll into a spot we know will be in
550 # the runtime path for GenerateCLP (which depends on python).
551 # We can't put this in the system path, since developer studio ignores
552 # the environment variables (or if you pass it the /UseEnv flag it
553 # can't find it's own executables).
554 if { $::USE_PYTHON == "ON" } {
555 if { ![file exists bin] } { file mkdir bin }
556 if { ![file exists bin/$::VTK_BUILD_TYPE] } { file mkdir bin/$::VTK_BUILD_TYPE }
557 if { ![file exists bin/$::VTK_BUILD_TYPE/python26.dll] } {
558 file copy $::Slicer3_LIB/python-build/PCbuild/python26.dll bin/$::VTK_BUILD_TYPE
559 }
560 }
561
562 if { $MSVC6 } {
563 eval runcmd $::MAKE Slicer3.dsw /MAKE $::GETBUILDTEST(test-type)
564 if { $::GETBUILDTEST(pack) == "true" } {
565 eval runcmd $::MAKE Slicer3.dsw /MAKE package
566 }
567 } else {
568 # tell cmake explicitly what command line to run when doing the ctest builds
569 set makeCmd "$::MAKE Slicer3.sln /out buildlog.txt /build $::VTK_BUILD_TYPE /project ALL_BUILD"
570 runcmd $::CMAKE -DCTEST_TEST_TIMEOUT=180 -DMAKECOMMAND:STRING=$makeCmd $Slicer3_HOME
571
572 if { $::GETBUILDTEST(test-type) == "" } {
573 runcmd $::MAKE Slicer3.SLN /out buildlog.txt /build $::VTK_BUILD_TYPE
574 } else {
575 # running ctest through visual studio is broken in cmake2.4, so run ctest directly
576 runcmd $::CMAKE_PATH/bin/ctest -D $::GETBUILDTEST(test-type) -C $::VTK_BUILD_TYPE
577 }
578
579 if { $::GETBUILDTEST(pack) == "true" } {
580 runcmd $::MAKE Slicer3.SLN /out packlog.txt /build $::VTK_BUILD_TYPE /project PACKAGE
581 }
582 }
583 } else {
584 set buildReturn [catch "eval runcmd $::MAKE $::GETBUILDTEST(test-type)"]
585 if { $::GETBUILDTEST(pack) == "true" } {
586 set packageReturn [catch "eval runcmd $::MAKE package"]
587 }
588
589 puts "\nResults: "
590 puts "build of \"$::GETBUILDTEST(test-type)\" [if $buildReturn "concat failed" "concat succeeded"]"
591 if { $::GETBUILDTEST(pack) == "true" } {
592 puts "package [if $packageReturn "concat failed" "concat succeeded"]"
593 }
594 }
595
596 # upload
597
598 if {$::GETBUILDTEST(upload) == "true"} {
599 set scpfile "${::GETBUILDTEST(binary-filename)}${::GETBUILDTEST(cpack-extension)}"
600 set namic_path "/clients/Slicer3/WWW/Downloads"
601 if {$::GETBUILDTEST(pack) == "true" &&
602 [file exists $::Slicer3_BUILD/$scpfile] &&
603 $::GETBUILDTEST(upload) == "true"} {
604 puts "About to do a $::GETBUILDTEST(uploadFlag) upload with $scpfile"
605 }
606
607 switch $::GETBUILDTEST(uploadFlag) {
608 "nightly" {
609 # reset the file name - take out the date
610 #set ex ".${::GETBUILDTEST(version-patch)}"
611 #regsub $ex $scpfile "" scpNightlyFile
612 #set scpfile $scpNightlyFile
613 set scpdest "${namic_path}/Nightly"
614 }
615 "snapshot" {
616 set scpdest "${namic_path}/Snapshots/$::env(BUILD)"
617 }
618 "release" {
619 set scpdest "${namic_url}/Release/$::env(BUILD)"
620 }
621 default {
622 puts "Invalid ::GETBUILDTEST(uploadFlag) \"$::GETBUILDTEST(uploadFlag)\", setting scpdest to nightly value"
623 set scpdest "${namic_path}/Nightly"
624 }
625 }
626
627 puts " -- upload $scpfile to $scpdest"
628 set curlcmd ""
629 switch $::tcl_platform(os) {
630 "SunOS" -
631 "Linux" {
632 set scpcmd "/usr/bin/scp $scpfile hayes@na-mic1.bwh.harvard.edu:$scpdest"
633 }
634 "Darwin" {
635 set scpcmd "/usr/bin/scp $scpfile hayes@na-mic1.bwh.harvard.edu:$scpdest"
636 }
637 default {
638 set scpcmd "scp $scpfile hayes@na-mic1.bwh.harvard.edu:$scpdest"
639 }
640 }
641
642 set scpReturn [catch "eval runcmd [split $scpcmd]"]
643 if {$scpReturn} {
644 puts "Upload failed..."
645 } else {
646 puts "See http://www.na-mic.org/Slicer/Download, in the $::GETBUILDTEST(uploadFlag) directory, for the uploaded file."
647 }
648 }
649
650
651 #
652 # build slicer extensions if requested on the command line
653 #
654
655 if { $::GETBUILDTEST(extend) == "true" } {
656 # build the slicer3 extensions
657 cd $::Slicer3_HOME
658 set cmd "sh ./Scripts/extend.tcl $::GETBUILDTEST(test-type) $::GETBUILDTEST(release)"
659 eval runcmd $cmd
660 }
661

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.22