.gitlab-ci.yml 3.95 KB
Newer Older
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
7
# efficient cloning step.
8
# Furthermore, Git-LFS and Gitlab sufer a bug preventing usage of
9 10
# GIT_STRATEGY=fetch (https://gitlab.com/gitlab-org/gitlab-runner/issues/3318)

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

before_script:
23
  # Provision efficiently the local LFS cache before checkout
24
  - git lfs fetch origin $CI_COMMIT_SHA
25
  # Checkout the expected branch
26
  - git checkout -f -q $CI_COMMIT_SHA
27

28
after_script:
Antoine Regimbeau's avatar
Antoine Regimbeau committed
29
  - python3 CI/cdash_handler.py $CI_COMMIT_SHA $CI_PROJECT_ID $CI_PROJECT_DIR $K8S_SECRET_CDASH
30

31
stages:
32
  - precheck
aregimbe's avatar
aregimbe committed
33
  - prepare
34 35
  - build

36
.general:
37 38 39 40 41 42
  retry:
    max: 2
    when:
      - runner_system_failure
      - stuck_or_timeout_failure

Antoine Regimbeau's avatar
Antoine Regimbeau committed
43 44 45 46 47 48 49
fast-build:
  extends: .general
  only: [merge_requests, branches]
  stage: precheck
  image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native-develop:latest
  before_script:
    - export GIT_LFS_SKIP_SMUDGE=1
50
    - git checkout -f -q $CI_COMMIT_SHA
Antoine Regimbeau's avatar
Antoine Regimbeau committed
51 52 53 54
    - python3 CI/check_twin_pipelines.py
  script:
    - ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-fast
    - ccache -s
55

Guillaume Pasero's avatar
Guillaume Pasero committed
56
.common-build:
57 58 59
  extends: .general
  only: [merge_requests]
  stage: build
60
  dependencies: []
Guillaume Pasero's avatar
Guillaume Pasero committed
61 62 63

debian-build:
  extends: .common-build
64 65 66
  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
67

Guillaume Pasero's avatar
Guillaume Pasero committed
68 69
ubuntu-llvm:
  extends: .common-build
70
  image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native:18.04
71
  script:
72
    - 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
73 74 75 76 77
  artifacts:
    paths:
      - build/CookBook-*-html.tar.gz
      - build/Documentation/Cookbook/latex/CookBook-*.pdf
      - build/Documentation/Doxygen/OTB-Doxygen-*.tar.bz2
aregimbe's avatar
aregimbe committed
78

79
.common-prepare:
aregimbe's avatar
aregimbe committed
80
  extends: .general
Guillaume Pasero's avatar
Guillaume Pasero committed
81
  only: [merge_requests]
aregimbe's avatar
aregimbe committed
82 83 84
  stage: prepare
  before_script:
# This override the previous before_script
85
    - export GIT_LFS_SKIP_SMUDGE=1
86
    - git checkout -f -q $CI_COMMIT_SHA
87
    - export GIT_LFS_SKIP_SMUDGE=0
aregimbe's avatar
aregimbe committed
88
# This is for debug, we are checking the owner of the ssh key
Guillaume Pasero's avatar
Guillaume Pasero committed
89
    - ls -al ~/
Guillaume Pasero's avatar
Guillaume Pasero committed
90 91
    - cat ~/.ssh/known_hosts
    - ssh -vvv -T git@gitlab.orfeo-toolbox.org
92 93
  after_script:
    - echo "Nothing to do for after_script"
aregimbe's avatar
aregimbe committed
94 95 96 97 98
  artifacts:
    expire_in: 24 hrs
    paths:
      # This recovers logs from superbuild build
      - build/*/*/*/*.log
99
      - sb_branch.txt
aregimbe's avatar
aregimbe committed
100

101 102 103 104
ubuntu-superbuild-prepare:
  extends: .common-prepare
  image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
  script:
Antoine Regimbeau's avatar
Antoine Regimbeau committed
105
    - ctest -V -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
106 107 108 109 110

centos-superbuild-prepare:
  extends: .common-prepare
  image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
  script:
111
    - ctest -V -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
112

113 114 115 116
ubuntu-superbuild-build:
  extends: .common-build
  image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
  script:
Antoine Regimbeau's avatar
Antoine Regimbeau committed
117
    - 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
118 119
  dependencies:
    - ubuntu-superbuild-prepare
120 121

centos-superbuild-build:
Guillaume Pasero's avatar
Guillaume Pasero committed
122
  extends: .common-build
123 124
  image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
  script:
125
    - 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
126
  dependencies:
127
    - centos-superbuild-prepare