Skip to content

Commit

Permalink
Adding verbose output to UpdateGitDocs build step
Browse files Browse the repository at this point in the history
- attempting to resolve failures when building additional docs
  • Loading branch information
hkaiser committed Apr 21, 2022
1 parent f1433bd commit c7d1b9f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 9 deletions.
16 changes: 13 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ core_dependency: &core_dependency
- core
<<: *gh_pages_filter

additional_docs_filter: &additional_docs_filter
filters:
branches:
only:
- master
- /release.*/
tags:
ignore: stable
<<: *gh_pages_filter

add_github_to_known_hosts: &add_github_to_known_hosts
run:
name: Add Github's key(s) to known_hosts
Expand Down Expand Up @@ -713,7 +723,7 @@ jobs:
# is enabled, and other machines may fail similarly.
cmake \
-DHPX_WITH_DATAPAR_VC=Off .
ninja -j2 install
ninja -v -j2 install
working_directory: /hpx/build
when: always
no_output_timeout: 30m
Expand Down Expand Up @@ -873,14 +883,14 @@ workflows:
# Force docs to be built after examples so that workspace doesn't
# have conflicts
- tests.examples
<<: *gh_pages_filter
<<: *additional_docs_filter
- docs-latexpdf:
requires:
- configure
# Force docs to be built after examples so that workspace doesn't
# have conflicts
- tests.examples
<<: *gh_pages_filter
<<: *additional_docs_filter
- docs_push:
requires:
- docs-html
Expand Down
29 changes: 23 additions & 6 deletions cmake/HPX_UpdateGitDocs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,25 @@ if(EXISTS "${HPX_BINARY_DIR}/docs/gh-pages")
COMMAND "${GIT_EXECUTABLE}" pull --rebase
WORKING_DIRECTORY "${HPX_BINARY_DIR}/docs/gh-pages"
RESULT_VARIABLE git_pull_result
ERROR_VARIABLE git_pull_result_message COMMAND_ECHO STDERR
)
if(NOT "${git_pull_result}" EQUAL "0")
message(FATAL_ERROR "Updating the GitHub pages branch failed.")
message(
FATAL_ERROR
"Updating the GitHub pages branch failed: ${git_pull_result_message}."
)
endif()
else()
message("${GIT_EXECUTABLE}")
execute_process(
COMMAND "${GIT_EXECUTABLE}" clone ${GIT_REPOSITORY} gh-pages
RESULT_VARIABLE git_clone_result
ERROR_VARIABLE git_pull_result_message COMMAND_ECHO STDERR
)
if(NOT "${git_clone_result}" EQUAL "0")
message(
FATAL_ERROR
"Cloning the GitHub pages branch failed. Trying to clone ${GIT_REPOSITORY}"
"Cloning the GitHub pages branch failed: ${git_pull_result_message}. Trying to clone ${GIT_REPOSITORY}"
)
endif()
endif()
Expand Down Expand Up @@ -147,35 +152,47 @@ execute_process(
COMMAND "${GIT_EXECUTABLE}" add *
WORKING_DIRECTORY "${HPX_BINARY_DIR}/docs/gh-pages"
RESULT_VARIABLE git_add_result
ERROR_VARIABLE git_pull_result_message COMMAND_ECHO STDERR
)
if(NOT "${git_add_result}" EQUAL "0")
message(FATAL_ERROR "Adding files to the GitHub pages branch failed.")
message(
FATAL_ERROR
"Adding files to the GitHub pages branch failed: ${git_pull_result_message}."
)
endif()

# check if there are changes to commit
execute_process(
COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD
WORKING_DIRECTORY "${HPX_BINARY_DIR}/docs/gh-pages"
RESULT_VARIABLE git_diff_index_result
RESULT_VARIABLE git_diff_index_result COMMAND_ECHO STDERR
)
if(NOT "${git_diff_index_result}" EQUAL "0")
# commit changes
execute_process(
COMMAND "${GIT_EXECUTABLE}" commit -am "Updating Sphinx docs"
WORKING_DIRECTORY "${HPX_BINARY_DIR}/docs/gh-pages"
RESULT_VARIABLE git_commit_result
ERROR_VARIABLE git_pull_result_message COMMAND_ECHO STDERR
)
if(NOT "${git_commit_result}" EQUAL "0")
message(FATAL_ERROR "Committing to the GitHub pages branch failed.")
message(
FATAL_ERROR
"Committing to the GitHub pages branch failed: ${git_pull_result_message}."
)
endif()

# push everything up to github
execute_process(
COMMAND "${GIT_EXECUTABLE}" push
WORKING_DIRECTORY "${HPX_BINARY_DIR}/docs/gh-pages"
RESULT_VARIABLE git_push_result
ERROR_VARIABLE git_pull_result_message COMMAND_ECHO STDERR
)
if(NOT "${git_push_result}" EQUAL "0")
message(FATAL_ERROR "Pushing to the GitHub pages branch failed.")
message(
FATAL_ERROR
"Pushing to the GitHub pages branch failed: ${git_pull_result_message}."
)
endif()
endif()

0 comments on commit c7d1b9f

Please sign in to comment.