.gitlab-ci.yml 19.8 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 35 36 37
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
    - export X264_DIR=/opt/x264
    - export FFMPEG_DIR=/opt/ffmpeg-2.1.8
    - export PATH="${FFMPEG_DIR}/bin:${PATH}"
    - export LD_LIBRARY_PATH="${X264_DIR}/lib:${FFMPEG_DIR}/lib"
    - export PATH="/opt/cmake-3.14.5/bin:/opt/doxygen-1.8.7/bin:/opt/qt-4.8.7/bin/:${PATH}"
38 39 40 41 42 43 44
    - 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
45
          -DBUILD_DISPLAY_TESTING:BOOL=OFF
46
          -DBUILD_Caffe:BOOL=ON
47
          -DOPENCV_WITH_FFMPEG:BOOL=ON
48
          -DBUILD_LEGACY_COMMAND_LINE_PROGRAMS:BOOL=ON
49 50 51
          -DNIFTK_USE_CPPCHECK:BOOL=ON
          -DNIFTK_USE_KWSTYLE:BOOL=ON
          -DDESIRED_QT_VERSION:STRING=4
52
          -DNIFTK_Apps/NiftyMITK:BOOL=ON
53
          -DNIFTK_Apps/NiftyIGI:BOOL=ON
Matt Clarkson's avatar
Matt Clarkson committed
54
          -DNIFTK_Apps/NiftyView:BOOL=ON
55
          -DNIFTK_Apps/NiftyMIDAS:BOOL=ON
56
          ${src_dir}
57
    - make -j 1 
58

59
  only:
60
    - branches
61

62
  tags:
63
    - linux, continuous
64

65

66 67 68 69 70
Mac continuous build:

  stage: build

  script:
71 72 73 74 75 76 77
    - 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
78
          -DBUILD_DISPLAY_TESTING:BOOL=OFF
79
          -DBUILD_Caffe:BOOL=ON
80
          -DBUILD_LEGACY_COMMAND_LINE_PROGRAMS:BOOL=ON
81 82
          -DDESIRED_QT_VERSION:STRING=4
          -DNIFTYLINK_CHECK_COVERAGE=ON
83
          -DNIFTK_Apps/NiftyMITK:BOOL=ON
84
          -DNIFTK_Apps/NiftyIGI:BOOL=ON
Matt Clarkson's avatar
Matt Clarkson committed
85
          -DNIFTK_Apps/NiftyView:BOOL=ON
86
          -DNIFTK_Apps/NiftyMIDAS:BOOL=ON
87 88
          ${src_dir}
    - make -j 4
89 90

  only:
91
    - branches
92 93

  tags:
94
    - mac, continuous
95 96 97 98 99 100 101


Windows continuous build:

  stage: build

  script:
102 103 104 105
    - sb_dir=${sb_dir//\\//}
    - ep_dir=${ep_dir//\\//}
    - src_dir=${src_dir//\\//}
    - pb_dir=${pb_dir//\\//}
106 107 108 109 110
    - 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,"
111 112

  only:
113
    - branches
114 115

  tags:
116
    - windows, continuous
117 118


119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
#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
136 137 138 139 140 141


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

142
Linux continuous test:
143 144 145 146

  stage: test

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

152
  only:
153
    - branches
154

155
  tags:
156
    - linux, continuous
157 158


159 160 161 162 163
Mac continuous test:

  stage: test

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

  only:
170
    - branches
171 172

  tags:
173
    - mac, continuous
174 175 176 177 178 179 180


Windows continuous test:

  stage: test

  script:
181 182
    - cd ${pb_dir}
    - ${src_dir}/Utilities/NifTKContinuousTest.bat
183 184

  only:
185
    - branches
186 187

  tags:
188
    - windows, continuous
189 190


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


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

210 211 212 213 214
Continuous docs:

  stage: deploy

  script:
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
    - 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:"
230
    - scp niftk-${version}-docs.tar.bz2 jet:/cs/sys/www0/marine/html/cmic.cs.ucl.ac.uk/NifTK/docs
231
    - ssh jet "cd /cs/sys/www0/marine/html/cmic.cs.ucl.ac.uk/NifTK/docs ;
232
          rm -rf niftk-master-docs.tar.bz2 master ;
233
          tar xfj niftk-${version}-docs.tar.bz2 ;
234
          mv niftk-${version}-docs master ;
235 236 237
          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 {} \; ;
238
          chmod 644 niftk-master-docs.tar.bz2"
239 240

  only:
241
    - master
242 243

  tags:
244
    - linux, continuous
245 246


247 248 249 250
##########################################
# Continuous clean up jobs
##########################################

251 252 253 254 255
Linux continuous clean up:

  stage: cleanup

  script:
256 257
    - rm -rf ${sb_dir}
    - ${src_dir}/Utilities/niftk-ep-clean-up.sh ${src_dir} ${ep_dir} &
258 259 260 261

  when: always

  only:
262
    - branches
263 264

  tags:
265
    - linux, continuous
266 267 268 269 270 271 272


Mac continuous clean up:

  stage: cleanup

  script:
273 274
    - rm -rf ${sb_dir}
    - ${src_dir}/Utilities/niftk-ep-clean-up.sh ${src_dir} ${ep_dir} &
275 276 277 278

  when: always

  only:
279
    - branches
280 281

  tags:
282
    - mac, continuous
283 284 285 286 287 288 289


Windows continuous clean up:

  stage: cleanup

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

  when: always

  only:
  - branches

  tags:
  - windows, continuous


302 303 304 305 306 307 308 309 310 311 312 313 314 315 316
#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
317 318


319
##########################################
320
# Release build jobs
321
##########################################
322

323
Ubuntu 18.04 release build:
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342

  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}
343
    - make -j 4
344 345 346 347 348 349

  only:
    - tags

  tags:
    - linux, ubuntu-18.04, release
350 351


352 353 354
CentOS 7 release build:

  stage: build
355

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

381
  only:
382
    - tags
383 384

  tags:
385
    - linux, centos-7, release
386 387


388 389 390 391 392 393 394 395 396 397 398 399 400
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
401
          -DBUILD_DISPLAY_TESTING:BOOL=OFF
402 403 404 405 406 407
          -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
408
          -DNIFTK_Apps/NiftyMITK:BOOL=ON
409
          -DNIFTK_Apps/NiftyIGI:BOOL=ON
Matt Clarkson's avatar
Matt Clarkson committed
410 411
          -DNIFTK_Apps/NiftyView:BOOL=ON
          -DNIFTK_Apps/NiftyMIDAS:BOOL=OFF
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
          ${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
436
          -DNIFTK_Apps/NiftyMITK:BOOL=ON
437
          -DNIFTK_Apps/NiftyIGI:BOOL=ON
Matt Clarkson's avatar
Matt Clarkson committed
438 439
          -DNIFTK_Apps/NiftyView:BOOL=ON
          -DNIFTK_Apps/NiftyMIDAS:BOOL=OFF
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 482 483 484 485 486
          ${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


487 488 489 490
##########################################
# Release test jobs
##########################################

491 492
# Dummy test jobs to prevent that deploy job is preceded by clean job.

493
Ubuntu 18.04 release test:
494 495 496 497 498 499 500 501 502 503 504

  stage: test

  script:
    - echo

  only:
    - tags

  tags:
    - linux, ubuntu-18.04, release
505 506


507 508 509 510 511
CentOS 7 release test:

  stage: test

  script:
512
    - echo
513 514

  only:
515
    - tags
516 517

  tags:
518
    - linux, centos-7, release
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 572 573 574 575 576
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


577 578 579 580
##########################################
# Release deploy jobs
##########################################

581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601
# 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:"
602
    - scp niftk-${version}-docs.tar.bz2 jet:/cs/sys/www0/marine/html/cmic.cs.ucl.ac.uk/NifTK/docs
603
    - ssh cmiclab "cd /cs/sys/www0/marine/html/cmic.cs.ucl.ac.uk/NifTK/docs ;
604 605 606
          rm niftk-latest-docs.tar.bz2 latest ;
          tar xfj niftk-${version}-docs.tar.bz2 ;
          mv niftk-${version}-docs ${version} ;
607 608
          find ${version}/ -type f -exec chmod 644 {} \; ;
          find ${version}/ -type d -exec chmod 755 {} \; ;
609
          ln -s niftk-${version}-docs.tar.bz2 niftk-latest-docs.tar.bz2 ;
610
          ln -s ${version} latest"
611 612 613 614 615

  only:
    - tags

  tags:
616
    - linux, centos-7, release
617 618


619
Ubuntu 18.04 release installer:
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641

  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
642 643


644
CentOS 7 release installer:
645 646 647 648

  stage: deploy

  script:
649
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
650
    - export pb_dir="${sb_dir}/NifTK-build"
651
    - version=${CI_COMMIT_TAG}
652 653 654 655 656
    - 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
657
    - installer_file="niftk-${version}-${os_version}-x64.tar.bz2"
658
    - mv niftk-${niftk_version_string}.tar.bz2 ${installer_file}
659 660
    - 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/
661 662 663 664 665 666 667 668 669 670 671 672 673 674 675
    - 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}"
676

677
  only:
678
    - tags
679 680

  tags:
681
    - linux, centos-7, release
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 789 790 791 792 793

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


794
##########################################
795
# Release clean up jobs
796 797
##########################################

798
Ubuntu 18.04 release clean up:
799 800 801 802 803 804 805 806 807 808 809 810 811 812

  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
813 814


815 816 817 818 819
CentOS 7 release clean up:

  stage: cleanup

  script:
820
    - export sb_dir="${sb_dir:0:${#sb_dir}-1}R"
821
    - rm -rf ${sb_dir}
822 823 824 825

  when: always

  only:
826
    - tags
827 828

  tags:
829
    - linux, centos-7, release
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 893 894 895 896 897

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