Commit a7f979f2 authored by Guillaume Pasero's avatar Guillaume Pasero

MRG: Synchronize with branch develop

Conflicts:
	.gitlab-ci.yml
	CI/main_superbuild.cmake
	CI/prepare_superbuild.cmake
parents 13284a63 7b09c7e4
......@@ -18,17 +18,6 @@ variables:
# The fetch strategy fails with LFS and GitLab
GIT_STRATEGY: "clone"
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
stages:
- precheck
- prepare
......@@ -45,91 +34,121 @@ stages:
#~ extends: .general
#~ only: [merge_requests, branches]
#~ stage: precheck
#~ image: $CI_REGISTRY/gpasero/otb/otb-install-ubuntu-native
#~ image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native-develop:latest
#~ before_script:
#~ - export GIT_LFS_SKIP_SMUDGE=1
#~ - git checkout $CI_COMMIT_REF_NAME
#~ - git checkout -f -q $CI_COMMIT_SHA
#~ - python3 CI/check_twin_pipelines.py
#~ after_script:
#~ - python3 CI/cdash_handler.py
#~ script:
#~ - ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-fast
#~ - ccache -s
.common-build:
extends: .general
#~ only: [merge_requests]
stage: build
before_script:
- git lfs install --skip-repo
# Provision efficiently the local LFS cache before checkout
- git lfs fetch origin $CI_COMMIT_SHA
# Checkout the expected branch
- git checkout -f -q $CI_COMMIT_SHA
after_script:
- python3 CI/cdash_handler.py
artifacts:
when: on_failure
expire_in: 24 hrs
paths:
- build/*/*.log #CMake log
- log/*.txt # Others
#~ 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
.common-prepare:
extends: .general
only: [merge_requests]
stage: prepare
before_script:
- git checkout -f -q $CI_COMMIT_SHA
- git lfs install --skip-repo
- git config --global user.email "otbbot@orfeo-toolbox.org"
- git config --global user.name "otbbot"
artifacts:
expire_in: 24 hrs
when: always
paths:
- sb_branch.txt # Needed to checkout correct branch in build step
- build/*/*/*/*.log # Superbuild log
## Ubuntu superbuild
#~ ubuntu-superbuild-prepare:
#~ 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
#~
#~ ubuntu-llvm:
#~ ubuntu-superbuild-build:
#~ extends: .common-build
#~ image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native:18.04
#~ 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_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-llvm
#~ - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=ubuntu-18.04-llvm-xdk
#~ - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
#~ dependencies:
#~ - ubuntu-superbuild-prepare
#~ 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
#~ 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
#~ - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
#~
#~ 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
#~ - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
#~ dependencies:
#~ - centos-superbuild-prepare
## MacOS superbuild
#~ macos-superbuild-prepare:
#~ tags:
#~ - macos
#~ extends: .common-prepare
#~ before_script:
#~ # No need to install lfs as this machine is persistent
#~ # No need to do git config
#~ # Checkout the expected branch
#~ - export GIT_LFS_SKIP_SMUDGE=1
#~ - git checkout -f -q $CI_COMMIT_SHA
#~ - export GIT_LFS_SKIP_SMUDGE=0
#~ script:
#~ - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
#~
#~ macos-superbuild-build:
#~ tags:
#~ - macos
#~ extends: .common-build
#~ script:
#~ - ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
#~ - ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-macos-superbuild
#~ dependencies:
#~ - macos-superbuild-prepare
.windows-prepare:
extends: .general
# only: [merge_requests]
......@@ -145,9 +164,9 @@ stages:
expire_in: 24 hrs
when: always
paths:
# This recovers logs from superbuild build
- build/*/*/*/*.log
- sb_branch.txt
- sb_branch.txt # Needed to checkout correct branch in build step
- build/*/*/*/*.log # Superbuild log
windows-10-prepare:
extends: .windows-prepare
......@@ -200,3 +219,4 @@ windows-8-build:
- clcache.exe -s
dependencies:
- windows-8-prepare
......@@ -45,3 +45,4 @@ The copyright owner is *COPYRIGHT OWNER (OR OWNER'S AGENT)* and has signed the O
- The feature branch is (reasonably) up-to-date with the base branch
- Dashboard is green
- Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
- Optionally, run `git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i` on latest changes and commit
......@@ -64,25 +64,29 @@ if __name__ == "__main__":
sha1 = env['CI_COMMIT_SHA']
# are we in a merge_request pipeline ?
if 'CI_MERGE_REQUEST_IID' in env.keys():
if not CheckEnvParameters(['K8S_SECRET_TWIN_PIPELINE','CI_PROJECT_ID','CI_PIPELINE_ID']):
if not CheckEnvParameters(['K8S_SECRET_API_TOKEN']):
print("Make sure you have set a valid acces token for Gitlab API")
print("The K8S_SECRET_API_TOKEN environment variable should be set in 'Settings -> CI/CD -> Variables'")
sys.exit(1)
mrInfo = GitlabRequest('merge_requests/'+env['CI_MERGE_REQUEST_IID'],token=env['K8S_SECRET_TWIN_PIPELINE'])
if not CheckEnvParameters(['CI_PROJECT_ID','CI_PIPELINE_ID']):
sys.exit(1)
mrInfo = GitlabRequest('merge_requests/'+env['CI_MERGE_REQUEST_IID'],token=env['K8S_SECRET_API_TOKEN'])