.gitlab-ci.yml 4.28 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
  BUILD_IMAGE_REGISTRY: $CI_REGISTRY/gbonnefille/otb-build-env
Sébastien Dinot's avatar
Sébastien Dinot committed
13
  DOCKER_DRIVER: overlay2
14
  GIT_DEPTH: "3"
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
15
  # Disable automatic checkout to let us fetch LFS before
16
  GIT_CHECKOUT: "false"
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
17
  # The fetch strategy fails with LFS and GitLab
18
  GIT_STRATEGY: "clone"
19 20

before_script:
21 22
  # make sure LFS hooks are installed
  - git lfs install
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
23
  # Provision efficiently the local LFS cache before checkout
24
  - git lfs fetch origin $CI_COMMIT_SHA
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
25
  # Checkout the expected branch
26
  - git checkout $CI_COMMIT_REF_NAME
Sébastien Dinot's avatar
Sébastien Dinot committed
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

Sébastien Dinot's avatar
Sébastien Dinot committed
31
stages:
aregimbe's avatar
aregimbe committed
32
  - prepare
Sébastien Dinot's avatar
Sébastien Dinot committed
33 34
  - build

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

42 43 44 45 46 47
# native-build:
#   extends: .general
#   only: [merge_requests]
#   stage: build
#   image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native:18.04
#   script:
48
#     - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-gcc
Antoine Regimbeau's avatar
Antoine Regimbeau committed
49

50
# debian-build:
51 52 53 54 55 56
#   extends: .general
#   only: [merge_requests]
#   stage: 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
57

58
.common-build:
59
  extends: .general
Antoine Regimbeau's avatar
Antoine Regimbeau committed
60
  stage: build
61
  image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-shark:18.04
Antoine Regimbeau's avatar
Antoine Regimbeau committed
62
  script:
63
    - 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-shark
64

aregimbe's avatar
aregimbe committed
65

66 67 68 69
# # This is needed to have only one pipeline in a merge request context
# ubuntu-llvm:
#   only: [merge_requests]
#   extends: .common-build
70

71 72 73
# ubuntu-llvm-wip:
#   except: [merge_requests]
#   extends: .common-build
74

75 76
.common-prepare:
  # only: [merge_requests]
aregimbe's avatar
aregimbe committed
77
  extends: .general
aregimbe's avatar
aregimbe committed
78
  stage: prepare
79
  # image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
aregimbe's avatar
aregimbe committed
80 81 82 83 84 85 86 87 88 89 90 91
  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
aregimbe's avatar
aregimbe committed
92
    - ssh -o StrictHostKeyChecking=no -T git@gitlab.orfeo-toolbox.org
93 94
  # script:
  #  - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
95 96
  after_script:
    - echo "Nothing to do for after_script"
aregimbe's avatar
aregimbe committed
97 98 99 100 101
  artifacts:
    expire_in: 24 hrs
    paths:
      # This recovers logs from superbuild build
      - build/*/*/*/*.log
102
      - sb_branch.txt
aregimbe's avatar
aregimbe committed
103

104 105 106 107 108 109
# ubuntu-superbuild-prepare:
#   only: [merge_requests]
#   extends: .common-prepare
#   image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
#   script:
#     - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
110 111

centos-superbuild-prepare:
112
  only: [merge_requests, branches]
113 114 115 116 117
  extends: .common-prepare
  image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
  script:
    - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base

118 119 120 121 122 123 124
# ubuntu-superbuild-build:
#   only: [merge_requests]
#   extends: .common-build
#   stage: build
#   image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
#   script:
#     - ctest -VV -S CI/build_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
125 126

centos-superbuild-build:
127
  only: [merge_requests, branches]
aregimbe's avatar
aregimbe committed
128
  extends: .general
129 130 131
  stage: build
  image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
  script:
132
    - ctest -VV -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
133
  dependencies:
134
    - centos-superbuild-prepare