.gitlab-ci.yml 6.07 KB
Newer Older
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
1 2 3 4 5
# WARNING!
# OTB uses Git-LFS to store the (large) tests data.
# Git-LFS is mostly transparent for the user and recent versions
# are able to use Git-LFS quite efficiently.
# But Git fails to manage efficiently numerous LFS data.
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
6
# We have to use directly git-lfs wrapping commands to have an
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
7
# efficient cloning step.
8
# Furthermore, Git-LFS and Gitlab sufer a bug preventing usage of
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
9 10
# GIT_STRATEGY=fetch (https://gitlab.com/gitlab-org/gitlab-runner/issues/3318)

Sébastien Dinot's avatar
Sébastien Dinot committed
11
variables:
12 13
  BUILD_IMAGE_REGISTRY: $CI_REGISTRY/orfeotoolbox/otb-build-env
  GIT_CLONE_PATH: $CI_BUILDS_DIR/otb
Sébastien Dinot's avatar
Sébastien Dinot committed
14
  DOCKER_DRIVER: overlay2
15
  GIT_DEPTH: "3"
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
16
  # Disable automatic checkout to let us fetch LFS before
17
  GIT_CHECKOUT: "false"
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
18
  # The fetch strategy fails with LFS and GitLab
19
  GIT_STRATEGY: "clone"
20

21 22 23 24 25 26 27 28 29 30
before_script:
  # make sure LFS hooks are installed
  - git lfs install
  # Provision efficiently the local LFS cache before checkout
  - git lfs fetch origin $CI_COMMIT_SHA
  # Checkout the expected branch
  - git checkout $CI_COMMIT_REF_NAME

after_script:
  - python3 CI/cdash_handler.py $CI_COMMIT_SHA $CI_PROJECT_ID $CI_PROJECT_DIR $K8S_SECRET_CDASH
31

Sébastien Dinot's avatar
Sébastien Dinot committed
32
stages:
Guillaume Pasero's avatar
Guillaume Pasero committed
33
  - precheck
aregimbe's avatar
aregimbe committed
34
  - prepare
Sébastien Dinot's avatar
Sébastien Dinot committed
35 36
  - build

37
.general:
Sébastien Dinot's avatar
Sébastien Dinot committed
38 39 40 41 42 43
  retry:
    max: 2
    when:
      - runner_system_failure
      - stuck_or_timeout_failure

44 45 46 47 48 49 50 51 52 53 54 55
#~ fast-build:
  #~ extends: .general
  #~ only: [merge_requests, branches]
  #~ stage: precheck
  #~ image: $CI_REGISTRY/gpasero/otb/otb-install-ubuntu-native
  #~ before_script:
    #~ - export GIT_LFS_SKIP_SMUDGE=1
    #~ - git checkout $CI_COMMIT_REF_NAME
    #~ - python3 CI/check_twin_pipelines.py
  #~ script:
    #~ - ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-fast
    #~ - ccache -s
56 57 58

.common-build:
  extends: .general
59
  #~ only: [merge_requests]
60 61
  stage: build

62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
#~ debian-build:
  #~ extends: .common-build
  #~ image: $BUILD_IMAGE_REGISTRY/otb-debian-native:unstable
  #~ script:
    #~ - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=debian-unstable-gcc
#~ 
#~ ubuntu-llvm:
  #~ extends: .common-build
  #~ image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native:18.04
  #~ script:
    #~ - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-llvm
  #~ artifacts:
    #~ paths:
      #~ - build/CookBook-*-html.tar.gz
      #~ - build/Documentation/Cookbook/latex/CookBook-*.pdf
      #~ - build/Documentation/Doxygen/OTB-Doxygen-*.tar.bz2
#~ 
#~ .common-prepare:
  #~ extends: .general
  #~ only: [merge_requests]
  #~ stage: prepare
  #~ before_script:
#~ # This override the previous before_script
    #~ - git checkout $CI_COMMIT_REF_NAME
#~ # We are now doing the git-lfs install
#~ # This is done after the checkout so we avoid downloading Data
#~ # But we need it to upload the archive
    #~ - git-lfs install
    #~ - git config --global user.email "otbbot@orfeo-toolbox.org"
    #~ - git config --global user.name "otbbot"
    #~ - eval $(ssh-agent -s)
    #~ - ssh-add <(echo "$K8S_SECRET_SSH")
#~ # This is for debug, we are checking the owner of the ssh key
    #~ - ssh -o StrictHostKeyChecking=no -T git@gitlab.orfeo-toolbox.org
  #~ after_script:
    #~ - echo "Nothing to do for after_script"
  #~ artifacts:
    #~ expire_in: 24 hrs
    #~ paths:
      #~ # This recovers logs from superbuild build
      #~ - build/*/*/*/*.log
      #~ - sb_branch.txt
#~ 
#~ ubuntu-superbuild-prepare:
  #~ extends: .common-prepare
  #~ image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
  #~ script:
    #~ - ctest -V -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
#~ 
#~ centos-superbuild-prepare:
  #~ extends: .common-prepare
  #~ image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
  #~ script:
    #~ - ctest -V -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
#~ 
#~ ubuntu-superbuild-build:
  #~ extends: .common-build
  #~ image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
  #~ script:
    #~ - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
  #~ dependencies:
    #~ - ubuntu-superbuild-prepare
#~ 
#~ centos-superbuild-build:
  #~ extends: .common-build
  #~ image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
  #~ script:
    #~ - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
  #~ dependencies:
    #~ - centos-superbuild-prepare
Guillaume Pasero's avatar
Guillaume Pasero committed
132

133
.windows-prepare:
134
  extends: .general
135 136 137
  # only: [merge_requests]
  tags:
    - windows
aregimbe's avatar
aregimbe committed
138 139 140
  stage: prepare
  before_script:
# This override the previous before_script
141
    - set GIT_LFS_SKIP_SMUDGE=1
142
    - git checkout %CI_COMMIT_REF_NAME%
143
    - set GIT_LFS_SKIP_SMUDGE=0
144 145
  after_script:
    - echo No after_script
aregimbe's avatar
aregimbe committed
146 147
  artifacts:
    expire_in: 24 hrs
148
    when: always
aregimbe's avatar
aregimbe committed
149 150 151
    paths:
      # This recovers logs from superbuild build
      - build/*/*/*/*.log
152
      - sb_branch.txt
153 154 155 156

windows-10-prepare:
  extends: .windows-prepare
  script:
Guillaume Pasero's avatar
Guillaume Pasero committed
157
    - call ./CI/dev_env.bat x64 xdk 10
158 159 160 161
    - clcache.exe -s
    - ctest -C Release -V -S CI/prepare_superbuild.cmake
    - clcache.exe -s

Guillaume Pasero's avatar
Guillaume Pasero committed
162 163 164 165 166 167 168
windows-8-prepare:
  extends: .windows-prepare
  script:
    - call ./CI/dev_env.bat x64 xdk 8.1
    - clcache.exe -s
    - ctest -C Release -V -S CI/prepare_superbuild.cmake
    - clcache.exe -s
Guillaume Pasero's avatar
Guillaume Pasero committed
169

170
.common-windows-build:
Guillaume Pasero's avatar
Guillaume Pasero committed
171
  extends: .common-build
172 173 174 175 176
  before_script:
    - git lfs fetch origin %CI_COMMIT_SHA%
    - git checkout %CI_COMMIT_REF_NAME%
  after_script:
    - call ./CI/dev_env.bat x64 otb
177
    - python ./CI/cdash_handler.py %CI_COMMIT_SHA% %CI_PROJECT_ID% %CI_PROJECT_DIR% %K8S_SECRET_CDASH%
178 179 180

windows-10-build:
  extends: .common-windows-build
Guillaume Pasero's avatar
Guillaume Pasero committed
181 182 183 184 185 186 187 188 189 190 191
  tags:
    - windows
  script:
    - call ./CI/dev_env.bat x64 otb 10
    - clcache.exe -s
    - ctest -V -S CI/main_superbuild.cmake
    - clcache.exe -s
  dependencies:
    - windows-10-prepare

windows-8-build:
192
  extends: .common-windows-build
Guillaume Pasero's avatar
Guillaume Pasero committed
193 194 195 196 197 198 199 200 201
  tags:
    - windows
  script:
    - call ./CI/dev_env.bat x64 otb 8.1
    - clcache.exe -s
    - ctest -V -S CI/main_superbuild.cmake
    - clcache.exe -s
  dependencies:
    - windows-8-prepare