vtk-m2/.gitlab/ci/ctest_configure.cmake
Robert Maynard 24a264fce8 Add scripts to allow developers to replicate CI environments
To simplify reproducing docker based CI workers locally, VTK-m has python program that handles all the
work automatically for you.

The program is located in `[Utilities/CI/reproduce_ci_env.py ]` and requires python3 and pyyaml.

To use the program is really easy! The following two commands will create the `build:rhel8` gitlab-ci
worker as a docker image and setup a container just as how gitlab-ci would be before the actual
compilation of VTK-m. Instead of doing the compilation, instead you will be given an interactive shell.

```
./reproduce_ci_env.py create rhel8
./reproduce_ci_env.py run rhel8
```

To compile VTK-m from the the interactive shell you would do the following:
```
> src]# cd build/
> build]# cmake --build .
```
2020-04-09 13:54:20 -04:00

51 lines
1.4 KiB
CMake

##=============================================================================
##
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
##
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##
##=============================================================================
cmake_minimum_required(VERSION 3.8)
# Read the files from the build directory that contain
# host information ( name, parallel level, etc )
include("$ENV{CI_PROJECT_DIR}/build/CIState.cmake")
ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
set(cmake_args
-C "${CMAKE_CURRENT_LIST_DIR}/config/initial_config.cmake")
# Create an entry in CDash.
ctest_start(Experimental TRACK "${CTEST_TRACK}")
# Gather update information.
find_package(Git)
set(CTEST_UPDATE_VERSION_ONLY ON)
set(CTEST_UPDATE_COMMAND "${GIT_EXECUTABLE}")
# Don't do updates when running via reproduce_ci_env.py
if(NOT DEFINED ENV{GITLAB_CI_EMULATION})
ctest_update()
endif()
# Configure the project.
ctest_configure(APPEND
OPTIONS "${cmake_args}"
RETURN_VALUE configure_result)
# We can now submit because we've configured.
if(NOT DEFINED ENV{GITLAB_CI_EMULATION})
ctest_submit(PARTS Update)
ctest_submit(PARTS Configure)
endif()
if (configure_result)
message(FATAL_ERROR
"Failed to configure")
endif ()