Commit a7f979f2 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

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'])
wip_regex = re.compile("^[Ww][Ii][Pp]:")
# is it a "WIP" merge request ?
if wip_regex.search(mrInfo["title"]):
# Yes: cancel the current pipeline
print("Cancel current pipeline "+env['CI_PIPELINE_ID'])
GitlabRequest('pipelines/'+env['CI_PIPELINE_ID']+'/cancel', data={}, \
project=env['CI_PROJECT_ID'], token=env['K8S_SECRET_TWIN_PIPELINE'])
project=env['CI_PROJECT_ID'], token=env['K8S_SECRET_API_TOKEN'])
time.sleep(180)
print("Error: this pipeline should have been canceled")
sys.exit(1)
else:
# No: cancel any previous "normal" pipeline on the same SHA1
jres = GitlabRequest('pipelines?sha='+sha1, project=env['CI_PROJECT_ID'], token=env['K8S_SECRET_TWIN_PIPELINE'])
jres = GitlabRequest('pipelines?sha='+sha1, project=env['CI_PROJECT_ID'], token=env['K8S_SECRET_API_TOKEN'])
for item in jres:
if item["id"] < int(env['CI_PIPELINE_ID']) and item["status"] == "running":
print("Cancel pipeline "+str(item["id"]))
jres2 = GitlabRequest('pipelines/'+str(item["id"])+'/cancel', data={}, \
project=env['CI_PROJECT_ID'], token=env['K8S_SECRET_TWIN_PIPELINE'])
project=env['CI_PROJECT_ID'], token=env['K8S_SECRET_API_TOKEN'])
......@@ -38,7 +38,7 @@ OTB_USE_GLEW:BOOL=ON
OTB_USE_GLFW:BOOL=ON
OTB_USE_GLUT:BOOL=ON
OTB_USE_GSL:BOOL=ON
OTB_USE_LIBKML:BOOL=ON
OTB_USE_LIBKML:BOOL=OFF
OTB_USE_LIBSVM:BOOL=ON
OTB_USE_MPI:BOOL=OFF
OTB_USE_MUPARSER:BOOL=ON
......@@ -51,12 +51,12 @@ OTB_USE_QWT:BOOL=ON
OTB_USE_SHARK:BOOL=ON
OTB_USE_SIFTFAST:BOOL=ON
OTB_USE_SPTW:BOOL=ON
OTB_USE_SSE_FLAGS:BOOL=ON
OTB_MPIEXEC_OPT:STRING=--allow-run-as-root")
OTB_USE_SSE_FLAGS:BOOL=ON")
# Usefull if MPI is ON : OTB_MPIEXEC_OPT:STRING=--allow-run-as-root
set (otb_wrap_option
"OTB_WRAP_JAVA:BOOL=ON
OTB_WRAP_PYTHON:BOOL=ON")
"OTB_WRAP_PYTHON:BOOL=ON")
set (otb_data_option
"OTB_DATA_USE_LARGEINPUT:BOOL=OFF
......@@ -66,6 +66,18 @@ set (cmake_configure_option
"CMAKE_BUILD_TYPE=${CTEST_BUILD_CONFIGURATION}
CMAKE_INSTALL_PREFIX:PATH=${CTEST_INSTALL_DIRECTORY}")
# extra options for XDK builds
if(XDK_PATH)
set(cmake_configure_option
"${cmake_configure_option}
CMAKE_PREFIX_PATH=${XDK_PATH}")
foreach(remote_module OTBTemporalGapFilling Mosaic SertitObject DiapOTBModule)#otbGRM
set(cmake_configure_option
"${cmake_configure_option}
Module_${remote_module}:BOOL=ON")
endforeach()
endif()
if((CTEST_SITE) AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/${CTEST_SITE}.cmake")
# will set its output in 'site_option'
include("${CMAKE_CURRENT_LIST_DIR}/${CTEST_SITE}.cmake")
......
......@@ -51,3 +51,70 @@ macro( set_dash_build_name )
endif()
endmacro()
# Download and extract an XDK (needs OTB_SOURCE_DIR, and the file sb_branch.txt in it)
macro(get_xdk)
# How to get md5sum:
# * concatenate all source files in one
# * add configure result from previous job ${OTB_SOURCE_DIR}/build/CMakeCache.txt
file(STRINGS "${OTB_SOURCE_DIR}/sb_branch.txt" BRANCH_NAME LIMIT_COUNT 1 REGEX "^([A-Za-z0-9]|/|-|_|\\.)+" )
# Look for a GIT command-line client.
find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
# Download xdk :
# git clone $REPOSITORY_URL --branch $BRANCH_NAME --depth 1 superbuild-artifact
set ( REMOTE "https://gitlab.orfeo-toolbox.org/gbonnefille/superbuild-artifact.git")
execute_process(
COMMAND ${CTEST_GIT_COMMAND} "clone" "${REMOTE}" "--branch" "${BRANCH_NAME}"
"--depth" "1" "superbuild-artifact"
WORKING_DIRECTORY ${OTB_SOURCE_DIR}
RESULT_VARIABLE clone_res
OUTPUT_VARIABLE clone_out
ERROR_VARIABLE clone_err
)
if ( DEBUG )
message( "Clone")
message( "clone_res = ${clone_res}" )
message( "clone_out = ${clone_out}" )
message( "clone_err = ${clone_err}" )
endif()
if (clone_res)
message( "Command : COMMAND ${CTEST_GIT_COMMAND} clone ${REMOTE} --branch ${BRANCH_NAME} \
--depth 1 superbuild-artifact")
message( "Result :")
message( "clone_res = ${clone_res}" )
message( "clone_out = ${clone_out}" )
message( "clone_err = ${clone_err}" )
message( FATAL_ERROR "Problem in retreiving the archive")
endif()
execute_process(
COMMAND ${CMAKE_COMMAND} "-E" "tar" "xf"
"${OTB_SOURCE_DIR}/superbuild-artifact/SuperBuild_Install.tar"
RESULT_VARIABLE tar_res
OUTPUT_VARIABLE tar_out
ERROR_VARIABLE tar_err
WORKING_DIRECTORY ${OTB_SOURCE_DIR}
)
if ( DEBUG )
message( "${CMAKE_COMMAND} -E tar xf ${OTB_SOURCE_DIR}/superbuild-artifact/SuperBuild_Install.tar")
message( "tar_res: '${clone_res}'" )
message( "tar_out: '${tar_out}'" )
message( "tar_err: '${tar_err}'" )
endif()
set( XDK_PATH "${OTB_SOURCE_DIR}/xdk")
if ( DEBUG )
if ( EXISTS "${XDK_PATH}")
message("Xdk folder exists at ${XDK_PATH}")
else()
message("Something went wrong no folder in ${XDK_PATH}")
message("The branch was ${BRANCH_NAME}")
endif()
endif()
endmacro()
......@@ -84,10 +84,10 @@ message(STATUS "CI profile : ${ci_profile}")
#The following file set the CONFIGURE_OPTIONS variable
set (ENABLE_DOXYGEN OFF)
set (CONFIGURE_OPTIONS "")
include ( "${CMAKE_CURRENT_LIST_DIR}/configure_option.cmake" )
include ( "${CMAKE_CURRENT_LIST_DIR}/configure_options.cmake" )
# Sources are already checked out : do nothing for update
set(CTEST_GIT_UPDATE_CUSTOM echo No update)
set(CTEST_GIT_UPDATE_CUSTOM "${CMAKE_COMMAND}" "-E" "echo" "No update")
# Look for a GIT command-line client.
find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
......@@ -99,12 +99,18 @@ ctest_start (Experimental TRACK CI_Build)
ctest_update()
# --------------------------- Configure ----------------------------------------
ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}"
SOURCE "${OTB_SOURCE_DIR}"
OPTIONS "${CONFIGURE_OPTIONS}"
RETURN_VALUE _configure_rv
CAPTURE_CMAKE_ERROR _configure_error
)
# Configure log
file ( WRITE
"${OTB_SOURCE_DIR}/log/configure_return_value_log.txt" "${_configure_rv}")
file ( WRITE
"${OTB_SOURCE_DIR}/log/configure_cmake_error_log.txt" "${_configure_error}")
if ( NOT _configure_rv EQUAL 0 )
# stop processing here
......@@ -112,15 +118,30 @@ if ( NOT _configure_rv EQUAL 0 )
message( FATAL_ERROR "An error occurs during ctest_configure.")
endif()
# ------------------------------ Build -----------------------------------------
if(ci_skip_install)
message(STATUS "Skip install")
set(CTEST_BUILD_TARGET)
else()
set(CTEST_BUILD_TARGET install)
endif()
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
RETURN_VALUE _build_rv
CAPTURE_CMAKE_ERROR _build_error
)
# Build log
file ( WRITE
"${OTB_SOURCE_DIR}/log/build_return_value_log.txt" "${_build_rv}")
file ( WRITE
"${OTB_SOURCE_DIR}/log/build_cmake_error_log.txt" "${_build_error}")
if ( NOT _build_rv EQUAL 0 )
message( SEND_ERROR "An error occurs during ctest_build.")
endif()
# ----------------------------- Test -------------------------------------------
if(ci_skip_testing)
message(STATUS "Skip testing")
set(_test_rv 0)
......@@ -129,16 +150,22 @@ else()
RETURN_VALUE _test_rv
CAPTURE_CMAKE_ERROR _test_error
)
# Test log
file ( WRITE
"${OTB_SOURCE_DIR}/log/test_return_value_log.txt" "${_test_rv}")
file ( WRITE
"${OTB_SOURCE_DIR}/log/test_cmake_error_log.txt" "${_test_error}")
endif()
if ( NOT _test_rv EQUAL 0 )
message( SEND_ERROR "An error occurs during ctest_test.")
endif()
# ----------------------------- Submit -----------------------------------------
ctest_submit()
# ---------------------------- Doxygen -----------------------------------------
if(ENABLE_DOXYGEN)
# compile doxygen
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
TARGET Documentation
RETURN_VALUE _doxy_rv
......
#
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# We are included from main_superbuild.cmake
# This script is a prototype for the future CI, it may evolve rapidly in a near future
include( "${CMAKE_CURRENT_LIST_DIR}/macros.cmake" )
set (ENV{LANG} "C") # Only ascii output
get_filename_component( OTB_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY )
set ( DEBUG "1" )
set ( CTEST_BUILD_CONFIGURATION "Release" )
set ( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
set ( CTEST_BUILD_FLAGS "-j1" )
set ( CTEST_BUILD_NAME "Packages" )
set ( CTEST_SITE "${IMAGE_NAME}" )
# Find the build name and CI profile
set_dash_build_name()
# Directory variable
set ( CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}/Packaging" )
set ( CTEST_BINARY_DIRECTORY "${OTB_SOURCE_DIR}/build_packages/" )
set ( CTEST_INSTALL_DIRECTORY "${OTB_SOURCE_DIR}/install_packages" )
set ( PROJECT_SOURCE_DIR "${CTEST_SOURCE_DIRECTORY}" )
# Copy back xdk for RUN_PATH reason
# We might want to change the name of artifact in main_superbuild
# file ( COPY "${OTB_SOURCE_DIR}/install/xdk" DESTINATION "${CI_ROOT_DIR}")
# Packages case:
# SUPERBUILD_BINARY_DIR this is needed for OTB_BINARY_DIR, not sure we need it
# SUPERBUILD_INSTALL_DIR do we need it? it seems so... We will set it to anything
# DOWNLOAD_LOCATION
# OTB_BINARY_DIR
# CMAKE_INSTALL_PREFIX
set ( CONFIGURE_OPTIONS
"-DCMAKE_INSTALL_PREFIX=${CTEST_INSTALL_DIRECTORY};\
-DOTB_BINARY_DIR=${OTB_SOURCE_DIR}/build;\
-DSUPERBUILD_INSTALL_DIR=${OTB_SOURCE_DIR}/xdk;\
-DSUPERBUILD_BINARY_DIR=${OTB_SOURCE_DIR}/build;" )
# Look for a GIT command-line client.
find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
# Sources are already checked out : do nothing for update
set(CTEST_GIT_UPDATE_CUSTOM echo No update)
ctest_start( Experimental TRACK CI_Package )
ctest_update( SOURCE "${OTB_SOURCE_DIR}" )
ctest_configure(
BUILD "${CTEST_BINARY_DIRECTORY}"
SOURCE "${CTEST_SOURCE_DIRECTORY}"
OPTIONS "${CONFIGURE_OPTIONS}"
RETURN_VALUE _configure_rv
CAPTURE_CMAKE_ERROR _configure_error
)
if( NOT _configure_rv EQUAL 0 )
ctest_submit()
message( SEND_ERROR "An error occurs during ctest_configure.")
return()
endif()
ctest_build(
BUILD "${CTEST_BINARY_DIRECTORY}"
TARGET PACKAGE-OTB
RETURN_VALUE _build_rv
CAPTURE_CMAKE_ERROR _build_error
)
if( NOT _build_rv EQUAL 0 )
message( SEND_ERROR "An error occurs during ctest_build.")
endif()
ctest_test(
PARALLEL_LEVEL 1
RETURN_VALUE _test_rv
CAPTURE_CMAKE_ERROR _test_error
)
if( NOT _test_rv EQUAL 0 )
message( SEND_ERROR "An error occurs during ctest_test.")
endif()
ctest_submit()
......@@ -22,107 +22,15 @@
include( "${CMAKE_CURRENT_LIST_DIR}/macros.cmake" )
set (ENV{LANG} "C") # Only ascii output
get_filename_component(OTB_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
###########################################################################
###########################################################################
# Download xkd
###########################################################################
###########################################################################
# How to get md5sum:
# * concatenate all source files in one
# * add configure result from previous job ${OTB_SOURCE_DIR}/build/CMakeCache.txt
###########################
file(READ "${OTB_SOURCE_DIR}/sb_branch.txt" BRANCH_NAME)
####################################
# git clone $REPOSITORY_URL --branch $BRANCH_NAME --depth 1 superbuild-artifact
###############################################################################
set ( REMOTE "https://gitlab.orfeo-toolbox.org/gbonnefille/superbuild-artifact.git")
# set ( BRANCH_NAME "${IMAGE_NAME}/${SB_MD5}")
# Look for a GIT command-line client.
find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
# FIXME: Replace ${GIT} variable with $[CTEST_GIT_COMMAND}"
set( GIT "${CTEST_GIT_COMMAND}" )
execute_process(
COMMAND ${GIT} "clone" "${REMOTE}" "--branch" "${BRANCH_NAME}"
"--depth" "1" "superbuild-artifact"
WORKING_DIRECTORY ${OTB_SOURCE_DIR}
RESULT_VARIABLE clone_res
OUTPUT_VARIABLE clone_out
ERROR_VARIABLE clone_err
)
if ( DEBUG )
message( "Clone")
message( "clone_res = ${clone_res}" )
message( "clone_out = ${clone_out}" )
message( "clone_err = ${clone_err}" )
endif()
if (clone_res)
message( SEND_ERROR "Problem in retreiving the archive")
return()
endif()
get_filename_component(OTB_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY)
set ( DEBUG "1" )
set (CMAKE_COMMAND "cmake")
execute_process(
COMMAND ${CMAKE_COMMAND} "-E" "tar" "xf"
"${OTB_SOURCE_DIR}/superbuild-artifact/SuperBuild_Install.tar"
WORKING_DIRECTORY ${OTB_SOURCE_DIR}
)
set( XDK_PATH "${OTB_SOURCE_DIR}/xdk")
# retrieve XDK
get_xdk()
if ( DEBUG )
if ( EXISTS "${XDK_PATH}")
message("Xdk folder exists at ${XDK_PATH}")
else()
message("Something went wrong no folder in ${XDK_PATH}")
endif()
endif()
###########################################################################
###########################################################################