Commit 5bc002d1 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

gitlab-ci: fetch submodules inside the script

PowerShell doesn't make it easy to ignore a return code, so just do it
in CMake code instead.
parent 4e9a5f80
cmake_minimum_required(VERSION 2.8.8)
# Find Git.
find_program(GIT_COMMAND NAMES git git.cmd)
execute_process(
COMMAND "${GIT_COMMAND}" submodule update --init --recursive
OUTPUT_VARIABLE init_submodules
RESULT_VARIABLE res
ERROR_VARIABLE err
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Ignore the error; we just want to make sure the submodules are present.
# Check if we're in a merge request (nothing should be needed if not).
if ("$ENV{CI_MERGE_REQUEST_ID}" STREQUAL "")
return ()
endif ()
# Find Git.
find_program(GIT_COMMAND NAMES git git.cmd)
if (NOT GIT_COMMAND)
message(FATAL_ERROR
"`git` was not found.")
......
......@@ -68,7 +68,6 @@
- export PATH=$PWD/.gitlab:$PWD/.gitlab/cmake/bin:$PATH
- cmake --version
- ninja --version
- "git submodule update --init --recursive || :"
- git submodule foreach --recursive cmake -P "$PWD/.gitlab/ci/fetch_submodule.cmake"
- git submodule sync --recursive
- git submodule update --init --recursive
......
......@@ -64,7 +64,6 @@
# Download Qt
- cmake -P .gitlab/ci/download_qt.cmake
- export CMAKE_PREFIX_PATH=$PWD/.gitlab/qt
- "git submodule update --init --recursive || :"
- git submodule foreach --recursive cmake -P "$PWD/.gitlab/ci/fetch_submodule.cmake"
- git submodule sync --recursive
- git submodule update --init --recursive
......
......@@ -77,7 +77,6 @@
- Set-Item -Force -Path "env:PATH" -Value "$env:PATH;$pwdpath\build\install\bin;$pwdpath\build\install\Python"
- Set-Item -Force -Path "env:PYTHONHOME" -Value "$pwdpath\build\install\Python"
# Support submodule references to the user's fork.
- git submodule update --init --recursive
- git submodule foreach --recursive cmake -P "$pwdpath/.gitlab/ci/fetch_submodule.cmake"
- git submodule sync --recursive
- git submodule update --init --recursive
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment