.gitlab-ci.yml 19.5 KB
Newer Older
1 2 3 4
stages:
  - build
  - test
  - deploy
5
  - cleanup
6 7 8

before_script:
  - export src_dir=${CI_PROJECT_DIR}
9
  - export git_hash=${CI_COMMIT_SHA:0:6}
10
  - export ep_dir="${CI_PROJECT_DIR}-ep"
11
  - export sb_dir="${CI_PROJECT_DIR}-sb-${git_hash}"
12 13 14 15
  - export pb_dir="${sb_dir}/NifTK-build"
  - hostname
  - whoami
  - pwd
16 17 18 19 20
  - echo "Sources - ${src_dir}"
  - echo "Commit - ${git_hash}"
  - echo "External projects - ${ep_dir}"
  - echo "Superbuild - ${sb_dir}"
  - echo "Project build - ${pb_dir}"
21

22

23
##########################################
24
# Continuous build jobs
25 26
##########################################

27
Linux continuous build:
28 29 30

  stage: build

31
  script:
32 33 34
    - export X264_DIR=/opt/x264
    - export FFMPEG_DIR=/opt/ffmpeg-2.1.8
    - export LD_LIBRARY_PATH="${X264_DIR}/lib:${FFMPEG_DIR}/lib"
35 36 37 38 39 40 41
    - mkdir -p ${sb_dir}
    - mkdir -p ${ep_dir}
    - cd ${sb_dir}
    - cmake -DEP_BASE:PATH=${ep_dir}
          -DEP_ALWAYS_USE_INSTALL_DIR:BOOL=OFF
          -DEP_DIRECTORY_PER_VERSION:BOOL=ON
          -DBUILD_TESTING:BOOL=ON
42
          -DBUILD_DISPLAY_TESTING:BOOL=OFF
43
          -DBUILD_Caffe:BOOL=ON
44
          -DOPENCV_WITH_FFMPEG:BOOL=ON
45
          -DBUILD_LEGACY_COMMAND_LINE_PROGRAMS:BOOL=ON
46 47 48
          -DNIFTK_USE_CPPCHECK:BOOL=ON
          -DNIFTK_USE_KWSTYLE:BOOL=ON
          -DDESIRED_QT_VERSION:STRING=4
49
          -DNIFTK_Apps/NiftyMITK:BOOL=ON
50
          -DNIFTK_Apps/NiftyIGI:BOOL=ON
Matt Clarkson's avatar
Matt Clarkson committed
51
          -DNIFTK_Apps/NiftyView:BOOL=ON
52
          -DNIFTK_Apps/NiftyMIDAS:BOOL=ON
53
          ${src_dir}
54
    - make -j 1 
55

56
  only:
57
    - branches
58

59
  tags:
60
    - linux, continuous
61

62

63 64 65 66 67
Mac continuous build:

  stage: build

  script:
68 69 70 71 72 73 74
    - mkdir -p ${sb_dir}
    - mkdir -p ${ep_dir}
    - cd ${sb_dir}
    - cmake -DEP_BASE:PATH=${ep_dir}
          -DEP_ALWAYS_USE_INSTALL_DIR:BOOL=OFF
          -DEP_DIRECTORY_PER_VERSION:BOOL=ON
          -DBUILD_TESTING:BOOL=ON
75
          -DBUILD_DISPLAY_TESTING:BOOL=OFF
76
          -DBUILD_Caffe:BOOL=ON
77
          -DBUILD_LEGACY_COMMAND_LINE_PROGRAMS:BOOL=ON
78 79
          -DDESIRED_QT_VERSION:STRING=4
          -DNIFTYLINK_CHECK_COVERAGE=ON
80
          -DNIFTK_Apps/NiftyMITK:BOOL=ON
81
          -DNIFTK_Apps/NiftyIGI:BOOL=ON
Matt Clarkson's avatar
Matt Clarkson committed
82
          -DNIFTK_Apps/NiftyView:BOOL=ON
83
          -DNIFTK_Apps/NiftyMIDAS:BOOL=ON
84 85
          ${src_dir}
    - make -j 4
86 87

  only:
88
    - branches
89 90

  tags:
91
    - mac, continuous
92 93 94 95 96 97 98


Windows continuous build:

  stage: build

  script:
99 100 101 102
    - sb_dir=${sb_dir//\\//}
    - ep_dir=${ep_dir//\\//}
    - src_dir=${src_dir//\\//}
    - pb_dir=${pb_dir//\\//}
103 104 105 106 107
    - mkdir -p ${sb_dir}
    - mkdir -p ${ep_dir}
    - cd ${sb_dir}
    - /c/Multi-Runner/slowrunner.exe -v -2 -e "${src_dir}/Utilities/NifTKContinuousBuild.bat"
    - tail -n 1 ${sb_dir}/build.log | grep -q ", 0 failed,"
108 109

  only:
110
    - branches
111 112

  tags:
113
    - windows, continuous
114 115


116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
#Windows 32 bit continuous build:
#
#  stage: build
#
#  script:
#    - mkdir -p ${sb_dir}
#    - mkdir -p ${ep_dir}
#    - cd ${sb_dir}
#    - export BTYPE=Win32
#    - /c/Multi-Runner/slowrunner.exe -v -2 -e "${src_dir}/Utilities/NifTKContinuousBuild.bat"
#    - tail -n 1 ${sb_dir}/build.log | grep -q ", 0 failed,"
#
#  only:
#    - branches
#
#  tags:
#    - windows-32bit, continuous
133 134 135 136 137 138


##########################################
# Continuous test jobs
##########################################

139
Linux continuous test:
140 141 142 143

  stage: test

  script:
144 145 146 147
    - cd ${pb_dir}
    - export NIFTK_DRC_ANALYZE=ON
    - export DISPLAY=mespak3.cs.ucl.ac.uk:1
    - ctest -S CTestContinuous.cmake -V
148

149
  only:
150
    - branches
151

152
  tags:
153
    - linux, continuous
154 155


156 157 158 159 160
Mac continuous test:

  stage: test

  script:
161 162 163 164
    - cd ${pb_dir}
    - export NIFTK_DRC_ANALYZE=ON
    - export DISPLAY=mespak3.cs.ucl.ac.uk:1
    - ctest -S CTestContinuous.cmake -V
165 166

  only:
167
    - branches
168 169

  tags:
170
    - mac, continuous
171 172 173 174 175 176 177


Windows continuous test:

  stage: test

  script:
178 179
    - cd ${pb_dir}
    - ${src_dir}/Utilities/NifTKContinuousTest.bat
180 181

  only:
182
    - branches
183 184

  tags:
185
    - windows, continuous
186 187


188 189 190 191 192 193 194 195 196 197 198 199 200
#Windows 32 bit continuous test:
#
#  stage: test
#
#  script:
#    - cd ${pb_dir}
#    - ${src_dir}/Utilities/NifTKContinuousTest.bat
#
#  only:
#    - branches
#
#  tags:
#    - windows-32bit, continuous
201 202 203 204 205 206


##########################################
# Continuous deploy jobs
##########################################

207 208 209 210 211
Continuous docs:

  stage: deploy

  script:
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
    - version=`git describe`
    - cd ${pb_dir}
    - rm -rf Doxygen/html
    - chmod a+rx bin/GenerateCommandLineDoxygen
    - bin/GenerateCommandLineDoxygen
    - chmod a+rx bin/GenerateTestingReports
    - bin/GenerateTestingReports
    - doxygen doxygen.config
    - cd Doxygen
    - find html -type f -exec chmod 644 {} \;
    - find html -type d -exec chmod 755 {} \;
    - rm -rf niftk-${version}-docs
    - mv html niftk-${version}-docs
    - tar cfj niftk-${version}-docs.tar.bz2 niftk-${version}-docs
    - echo "API reference documentation generated:"
227
    - scp niftk-${version}-docs.tar.bz2 jet:/cs/sys/www0/marine/html/cmic.cs.ucl.ac.uk/NifTK/docs
228
    - ssh jet "cd /cs/sys/www0/marine/html/cmic.cs.ucl.ac.uk/NifTK/docs ;
229
          rm -rf niftk-master-docs.tar.bz2 master ;
230
          tar xfj niftk-${version}-docs.tar.bz2 ;
231
          mv niftk-${version}-docs master ;
232 233 234
          mv niftk-${version}-docs.tar.bz2 niftk-master-docs.tar.bz2 ;
          find master -type f -exec chmod 644 {} \; ;
          find master -type d -exec chmod 755 {} \; ;
235
          chmod 644 niftk-master-docs.tar.bz2"
236 237

  only:
238
    - master
239 240

  tags:
241
    - linux, continuous
242 243


244 245 246 247
##########################################
# Continuous clean up jobs
##########################################

248 249 250 251 252
Linux continuous clean up:

  stage: cleanup

  script:
253 254
    - rm -rf ${sb_dir}
    - ${src_dir}/Utilities/niftk-ep-clean-up.sh ${src_dir} ${ep_dir} &
255 256 257 258

  when: always

  only:
259
    - branches
260 261

  tags:
262
    - linux, continuous
263 264 265 266 267 268 269


Mac continuous clean up:

  stage: cleanup

  script:
270 271
    - rm -rf ${sb_dir}
    - ${src_dir}/Utilities/niftk-ep-clean-up.sh ${src_dir} ${ep_dir} &
272 273 274 275

  when: always

  only:
276
    - branches
277 278

  tags:
279
    - mac, continuous
280 281 282 283 284 285 286


Windows continuous clean up:

  stage: cleanup

  script:
287 288
    - rm -rf ${sb_dir}
    - ${src_dir}/Utilities/niftk-ep-clean-up.sh ${src_dir} ${ep_dir} &
289 290 291 292 293 294 295 296 297 298

  when: always

  only:
  - branches

  tags:
  - windows, continuous


299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
#Windows 32 bit continuous clean up:
#
#  stage: cleanup
#
#  script:
#    - rm -rf ${sb_dir}
#    - ${src_dir}/Utilities/niftk-ep-clean-up.sh ${src_dir} ${ep_dir} &
#
#  when: always
#
#  only:
#    - branches
#
#  tags:
#    - windows-32bit, continuous
314 315


316
##########################################
317
# Release build jobs
318
##########################################
319

320
Ubuntu 18.04 release build:
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339

  stage: build

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - mkdir -p ${sb_dir}
    - cd ${sb_dir}
    - cmake -DBUILD_TESTING:BOOL=OFF
          -DBUILD_DISPLAY_TESTING:BOOL=OFF
          -DNIFTK_USE_CPPCHECK:BOOL=OFF
          -DNIFTK_USE_KWSTYLE:BOOL=OFF
          -DDESIRED_QT_VERSION:STRING=4
          -DBUILD_Python:BOOL=ON
          -DBUILD_Caffe:BOOL=ON
          -DNIFTK_Apps/NiftyMITK:BOOL=ON
          -DNIFTK_Apps/NiftyIGI:BOOL=ON
          -DNIFTK_Apps/NiftyView:BOOL=ON
          -DNIFTK_Apps/NiftyMIDAS:BOOL=OFF
          ${src_dir}
340
    - make -j 4
341 342 343 344 345 346

  only:
    - tags

  tags:
    - linux, ubuntu-18.04, release
347 348


349 350 351
CentOS 7 release build:

  stage: build
352

353
  script:
354
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
355 356
    - export X264_DIR=/opt/x264
    - export FFMPEG_DIR=/opt/ffmpeg-2.1.8
357
    - export LD_LIBRARY_PATH="${X264_DIR}/lib:${FFMPEG_DIR}/lib"
358 359 360
    - mkdir -p ${sb_dir}
    - cd ${sb_dir}
    - cmake -DBUILD_TESTING:BOOL=OFF
361
          -DBUILD_DISPLAY_TESTING:BOOL=OFF
362 363
          -DNIFTK_USE_CPPCHECK:BOOL=OFF
          -DNIFTK_USE_KWSTYLE:BOOL=OFF
364
          -DNIFTK_SITK_FLAGS:STRING="--single-version-externally-managed;--root=/"
365 366
          -DDESIRED_QT_VERSION:STRING=4
          -DBUILD_Python:BOOL=ON
367
          -DBUILD_Caffe:BOOL=ON
368
          -DOPENCV_WITH_FFMPEG:BOOL=ON
369
          -DNIFTK_Apps/NiftyMITK:BOOL=ON
370
          -DNIFTK_Apps/NiftyIGI:BOOL=ON
Matt Clarkson's avatar
Matt Clarkson committed
371 372
          -DNIFTK_Apps/NiftyView:BOOL=ON
          -DNIFTK_Apps/NiftyMIDAS:BOOL=OFF
373
          ${src_dir}
374
    - make -j 1 
375

376
  only:
377
    - tags
378 379

  tags:
380
    - linux, centos-7, release
381 382


383 384 385 386 387 388 389 390 391 392 393 394 395
CentOS 6 release build:

  stage: build

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - export X264_DIR=/share/apps/cmic/niftk/x264
    - export FFMPEG_DIR=/share/apps/cmic/niftk/ffmpeg-2.1.8
    - export PATH="${FFMPEG_DIR}/bin:${PATH}"
    - export LD_LIBRARY_PATH="${X264_DIR}/lib:${FFMPEG_DIR}/lib"
    - mkdir -p ${sb_dir}
    - cd ${sb_dir}
    - cmake -DBUILD_TESTING:BOOL=OFF
396
          -DBUILD_DISPLAY_TESTING:BOOL=OFF
397 398 399 400 401 402
          -DNIFTK_USE_CPPCHECK:BOOL=OFF
          -DNIFTK_USE_KWSTYLE:BOOL=OFF
          -DDESIRED_QT_VERSION:STRING=4
          -DBUILD_Python:BOOL=ON
          -DBUILD_Caffe:BOOL=ON
          -DOPENCV_WITH_FFMPEG:BOOL=ON
403
          -DNIFTK_Apps/NiftyMITK:BOOL=ON
404
          -DNIFTK_Apps/NiftyIGI:BOOL=ON
Matt Clarkson's avatar
Matt Clarkson committed
405 406
          -DNIFTK_Apps/NiftyView:BOOL=ON
          -DNIFTK_Apps/NiftyMIDAS:BOOL=OFF
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430
          ${src_dir}
    - make

  only:
    - tags

  tags:
    - linux, centos-6, release


Mac release build:

  stage: build

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - mkdir -p ${sb_dir}
    - cd ${sb_dir}
    - cmake -DBUILD_TESTING:BOOL=OFF
          -DNIFTK_USE_CPPCHECK:BOOL=OFF
          -DNIFTK_USE_KWSTYLE:BOOL=OFF
          -DDESIRED_QT_VERSION:STRING=4
          -DBUILD_Python:BOOL=ON
          -DBUILD_Caffe:BOOL=ON
431
          -DNIFTK_Apps/NiftyMITK:BOOL=ON
432
          -DNIFTK_Apps/NiftyIGI:BOOL=ON
Matt Clarkson's avatar
Matt Clarkson committed
433 434
          -DNIFTK_Apps/NiftyView:BOOL=ON
          -DNIFTK_Apps/NiftyMIDAS:BOOL=OFF
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481
          ${src_dir}
    - make -j 4

  only:
    - tags

  tags:
   - mac, release


Windows release build:

  stage: build

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - mkdir -p ${sb_dir}
    - cd ${sb_dir}
    - /c/Multi-Runner/slowrunner.exe -v -2 -e "${src_dir}/Utilities/NifTKReleaseBuild.bat"
    - tail -n 1 ${sb_dir}/build.log | grep -q ", 0 failed,"

  only:
    - tags

  tags:
    - windows, release


Windows 32 bit release build:

  stage: build

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - mkdir -p ${sb_dir}
    - cd ${sb_dir}
    - export BTYPE=Win32
    - /c/Multi-Runner/slowrunner.exe -v -2 -e "${src_dir}/Utilities/NifTKReleaseBuild.bat"
    - tail -n 1 ${sb_dir}/build.log | grep -q ", 0 failed,"

  only:
    - tags

  tags:
    - windows-32bit, release


482 483 484 485
##########################################
# Release test jobs
##########################################

486 487
# Dummy test jobs to prevent that deploy job is preceded by clean job.

488
Ubuntu 18.04 release test:
489 490 491 492 493 494 495 496 497 498 499

  stage: test

  script:
    - echo

  only:
    - tags

  tags:
    - linux, ubuntu-18.04, release
500 501


502 503 504 505 506
CentOS 7 release test:

  stage: test

  script:
507
    - echo
508 509

  only:
510
    - tags
511 512

  tags:
513
    - linux, centos-7, release
514 515


516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571
CentOS 6 release test:

  stage: test

  script:
    - echo

  only:
    - tags

  tags:
    - linux, centos-6, release


Mac release test:

  stage: test

  script:
    - echo

  only:
    - tags

  tags:
    - mac, release


Windows release test:

  stage: test

  script:
    - echo

  only:
    - tags

  tags:
    - windows, release


Windows 32 bit release test:

  stage: test

  script:
    - echo

  only:
    - tags

  tags:
    - windows-32bit, release


572 573 574 575
##########################################
# Release deploy jobs
##########################################

576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596
# Generating documentation pages for tagged releases
Release docs:

  stage: deploy

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - export pb_dir="${sb_dir}/NifTK-build"
    - version=${CI_COMMIT_TAG}
    - cd ${pb_dir}
    - rm -rf Doxygen/html
    - chmod a+rx bin/GenerateCommandLineDoxygen
    - bin/GenerateCommandLineDoxygen
    - doxygen doxygen.config
    - cd Doxygen
    - find html -type f -exec chmod 644 {} \;
    - find html -type d -exec chmod 755 {} \;
    - rm -rf niftk-${version}-docs
    - mv html niftk-${version}-docs
    - tar cfj niftk-${version}-docs.tar.bz2 niftk-${version}-docs
    - echo "API reference documentation generated:"
597
    - scp niftk-${version}-docs.tar.bz2 jet:/cs/sys/www0/marine/html/cmic.cs.ucl.ac.uk/NifTK/docs
598
    - ssh cmiclab "cd /cs/sys/www0/marine/html/cmic.cs.ucl.ac.uk/NifTK/docs ;
599 600 601
          rm niftk-latest-docs.tar.bz2 latest ;
          tar xfj niftk-${version}-docs.tar.bz2 ;
          mv niftk-${version}-docs ${version} ;
602 603
          find ${version}/ -type f -exec chmod 644 {} \; ;
          find ${version}/ -type d -exec chmod 755 {} \; ;
604
          ln -s niftk-${version}-docs.tar.bz2 niftk-latest-docs.tar.bz2 ;
605
          ln -s ${version} latest"
606 607 608 609 610

  only:
    - tags

  tags:
611
    - linux, centos-7, release
612 613


614
Ubuntu 18.04 release installer:
615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636

  stage: deploy

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - export pb_dir="${sb_dir}/NifTK-build"
    - version=${CI_COMMIT_TAG}
    - cd ${pb_dir}
    - niftk_version_string=`grep "NIFTK_VERSION_STRING:STRING" CMakeCache.txt | cut -c 29-`
    - source /etc/os-release
    - os_version="${ID}-${VERSION_ID}"
    - cpack --config CPackConfig.cmake
    - installer_file="niftk-${version}-${os_version}-x64.tar.bz2"
    - mv niftk-${niftk_version_string}.tar.bz2 ${installer_file}
    - ssh cmiclab "mkdir -p /cs/research/medic/cmiclab/deploy/CMIC/NifTK/install/$version"
    - scp ${installer_file} cmiclab:/cs/research/medic/cmiclab/deploy/CMIC/NifTK/install/$version/

  only:
    - tags

  tags:
    - linux, ubuntu-18.04, release
637 638


639
CentOS 7 release installer:
640 641 642 643

  stage: deploy

  script:
644
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
645
    - export pb_dir="${sb_dir}/NifTK-build"
646
    - version=${CI_COMMIT_TAG}
647 648 649 650 651
    - cd ${pb_dir}
    - niftk_version_string=`grep "NIFTK_VERSION_STRING:STRING" CMakeCache.txt | cut -c 29-`
    - source /etc/os-release
    - os_version="${ID}-${VERSION_ID}"
    - cpack --config CPackConfig.cmake
652
    - installer_file="niftk-${version}-${os_version}-x64.tar.bz2"
653
    - mv niftk-${niftk_version_string}.tar.bz2 ${installer_file}
654 655
    - ssh cmiclab "mkdir -p /cs/research/medic/cmiclab/deploy/CMIC/NifTK/install/$version"
    - scp ${installer_file} cmiclab:/cs/research/medic/cmiclab/deploy/CMIC/NifTK/install/$version/
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670
    - install_prefix=/cs/research/medic/common2/paramedic/share/cmic/niftk-scientific/niftk-${niftk_version_string}
    - install_tmp_dir="${install_prefix}-tmp"
    - ssh logno "mkdir ${install_tmp_dir} ;
          cd ${install_tmp_dir} ;
          wget https://cmiclab.cs.ucl.ac.uk/CMIC/NifTK/install/${installer_file} ;
          tar xfj ${installer_file} ;
          rm ${installer_file} ;
          cd `ls` ;
          install_path=`pwd` ;
          cd ../.. ;
          if [ -e ${install_prefix} ] ; then mv ${install_prefix} ${install_tmp_dir}/ ; fi ;
          mv ${install_path} ${install_prefix} ;
          rm niftk ;
          ln -s niftk-${niftk_version_string} niftk ;
          rm -rf ${install_tmp_dir}"
671

672
  only:
673
    - tags
674 675

  tags:
676
    - linux, centos-7, release
677

678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788

CentOS 6 release installer:

  stage: deploy

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - export pb_dir="${sb_dir}/NifTK-build"
    - export X264_DIR=/share/apps/cmic/niftk/x264
    - export FFMPEG_DIR=/share/apps/cmic/niftk/ffmpeg-2.1.8
    - export PATH="${FFMPEG_DIR}/bin:${PATH}"
    - export LD_LIBRARY_PATH="${X264_DIR}/lib:${FFMPEG_DIR}/lib"
    - version=${CI_COMMIT_TAG}
    - cd ${pb_dir}
    - niftk_version_string=`grep "NIFTK_VERSION_STRING:STRING" CMakeCache.txt | cut -c 29-`
    - os_version="centos-6"
    - cpack --config CPackConfig.cmake
    - installer_file="niftk-${version}-${os_version}-x64.tar.bz2"
    - mv niftk-${niftk_version_string}.tar.bz2 ${installer_file}
    - ssh cmiclab "mkdir -p /cs/research/medic/cmiclab/deploy/CMIC/NifTK/install/$version"
    - scp ${installer_file} cmiclab:/cs/research/medic/cmiclab/deploy/CMIC/NifTK/install/$version/
    - install_prefix=/share/apps/cmic/niftk/niftk-${niftk_version_string}
    - install_tmp_dir="${install_prefix}-tmp"
    - mkdir ${install_tmp_dir}
    - cd ${install_tmp_dir}
    - tar xfj ${pb_dir}/${installer_file}
    - cd `ls`
    - install_path=`pwd`
    - cd ../..
    - if [ -e ${install_prefix} ] ; then mv ${install_prefix} ${install_tmp_dir}/ ; fi
    - mv ${install_path} ${install_prefix}
    - rm niftk
    - ln -s niftk-${niftk_version_string} niftk
    - rm -rf ${install_tmp_dir}

  only:
    - tags

  tags:
    - linux, centos-6, release


Mac release installer:

  stage: deploy

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - export pb_dir="${sb_dir}/NifTK-build"
    - version=${CI_COMMIT_TAG}
    - cd ${pb_dir}
    - niftk_version_string=`grep "NIFTK_VERSION_STRING:STRING" CMakeCache.txt | cut -c 29-`
    - cpack --config CPackConfig.cmake
    - installer_file="niftk-${version}-mac-10.10.dmg"
    - mv niftk-${niftk_version_string}.dmg ${installer_file}
    - ssh cmiclab "mkdir -p /cs/research/medic/cmiclab/deploy/CMIC/NifTK/install/$version"
    - scp ${installer_file} cmiclab:/cs/research/medic/cmiclab/deploy/CMIC/NifTK/install/$version/

  only:
    - tags

  tags:
    - mac, release


Windows release installer:

  stage: deploy

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - export pb_dir="${sb_dir}/NifTK-build"
    - version=${CI_COMMIT_TAG}
    - cd ${pb_dir}
    - niftk_version_string=`grep "NIFTK_VERSION_STRING:STRING" CMakeCache.txt | cut -c 29-`
    - ${src_dir}/Utilities/NifTKReleaseDeploy.bat
    - installer_file="niftk-${version}-windows-7-x64.exe"
    - mv niftk-${niftk_version_string}.exe ${installer_file}
    - ssh cmiclab "mkdir -p /cs/research/medic/cmiclab/deploy/CMIC/NifTK/install/$version"
    - scp ${installer_file} cmiclab:/cs/research/medic/cmiclab/deploy/CMIC/NifTK/install/$version/

  only:
    - tags

  tags:
    - windows, release


Windows 32 bit release installer:

  stage: deploy

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - export pb_dir="${sb_dir}/NifTK-build"
    - version=${CI_COMMIT_TAG}
    - cd ${pb_dir}
    - niftk_version_string=`grep "NIFTK_VERSION_STRING:STRING" CMakeCache.txt | cut -c 29-`
    - ${src_dir}/Utilities/NifTKReleaseDeploy.bat
    - installer_file="niftk-${version}-windows-7-x86.exe"
    - mv niftk-${niftk_version_string}.exe ${installer_file}
    - ssh cmiclab "mkdir -p /cs/research/medic/cmiclab/deploy/CMIC/NifTK/install/$version"
    - scp ${installer_file} cmiclab:/cs/research/medic/cmiclab/deploy/CMIC/NifTK/install/$version/

  only:
    - tags

  tags:
    - windows-32bit, release


789
##########################################
790
# Release clean up jobs
791 792
##########################################

793
Ubuntu 18.04 release clean up:
794 795 796 797 798 799 800 801 802 803 804 805 806 807

  stage: cleanup

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - rm -rf ${sb_dir}

  when: always

  only:
    - tags

  tags:
    - linux, ubuntu-18.04, release
808 809


810 811 812 813 814
CentOS 7 release clean up:

  stage: cleanup

  script:
815
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
816
    - rm -rf ${sb_dir}
817 818 819 820

  when: always

  only:
821
    - tags
822 823

  tags:
824
    - linux, centos-7, release
825

826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892

CentOS 6 release clean up:

  stage: cleanup

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - rm -rf ${sb_dir}

  when: always

  only:
    - tags

  tags:
    - linux, centos-6, release


Mac release clean up:

  stage: cleanup

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - rm -rf ${sb_dir}

  when: always

  only:
    - tags

  tags:
    - mac, release


Windows release clean up:

  stage: cleanup

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - rm -rf ${sb_dir}

  when: always

  only:
    - tags

  tags:
    - windows, release


Windows 32 bit release clean up:

  stage: cleanup

  script:
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - rm -rf ${sb_dir}

  when: always

  only:
    - tags

  tags:
    - windows-32bit, release