Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 3.0.0)
project(h5cpp
LANGUAGES CXX C
VERSION 0.4.1
# VERSION 0.4.1
# documentation for VERSION with one '.' is stored as v:latest (see doc/conf.py.in)
VERSION 0.5
)


Expand Down
58 changes: 55 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,50 @@ builders = pipeline_builder.createBuilders { container ->
git checkout gh-pages
git pull
shopt -u dotglob && rm -rf ./*
mv -f ../build/doc/build/* ./
mv -f ../build/doc/doxygen_html ./doxygen
mkdir -p ./latest
mv -f ../build/doc/build/* ./latest/
mv -f ../build/doc/doxygen_html ./latest/doxygen
mv -f ../build/doc/index.html ./
find ./ -type d -name "CMakeFiles" -prune -exec rm -rf {} \\;
find ./ -name "Makefile" -exec rm -rf {} \\;
find ./ -name "*.cmake" -exec rm -rf {} \\;
rm -rf ./_sources
rm -rf ./latest/_sources
git add -A
git commit --amend -m 'Auto-publishing docs from Jenkins build ${BUILD_NUMBER} for branch ${BRANCH_NAME}'
"""

container.copyFrom("docs", "docs")
dir("docs") {
withCredentials([usernamePassword(
credentialsId: 'cow-bot-username-with-token',
usernameVariable: 'USERNAME',
passwordVariable: 'PASSWORD'
)]) {
withEnv(["PROJECT=${pipeline_builder.project}"]) {
sh '../$PROJECT/push_to_repo.sh $USERNAME $PASSWORD'
}
}
}
} else if (pipeline_builder.branch ==~ '/^docs_*/') {
def version = pipeline_builder.branch.substring(5)
container.copyTo(pipeline_builder.project, "docs")
container.setupLocalGitUser("docs")
container.sh """
cd docs

git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'

git fetch
git checkout gh-pages
git pull
shopt -u dotglob && rm -rf ./*
mkdir -p ./${version}
mv -f ../build/doc/build/* ./${version}/
mv -f ../build/doc/doxygen_html ./${version}/doxygen
find ./ -type d -name "CMakeFiles" -prune -exec rm -rf {} \\;
find ./ -name "Makefile" -exec rm -rf {} \\;
find ./ -name "*.cmake" -exec rm -rf {} \\;
rm -rf ./${version}/_sources
git add -A
git commit --amend -m 'Auto-publishing docs from Jenkins build ${BUILD_NUMBER} for branch ${BRANCH_NAME}'
"""
Expand All @@ -222,6 +260,20 @@ builders = pipeline_builder.createBuilders { container ->
} else {
container.copyFrom("build", "build")
archiveArtifacts artifacts: 'build/doc/build/'

if (pipeline_builder.branch ==~ '/^v?(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$/') {
def rlversion = pipeline_builder.branch
withCredentials([usernamePassword(
credentialsId: 'cow-bot-username-with-token',
usernameVariable: 'USERNAME',
passwordVariable: 'PASSWORD'
)]) {
withEnv(["PROJECT=${pipeline_builder.project}", "RLVERSION=${rlversion}"]) {
sh 'cd $PROJECT && git checkout -b docs_$RLVERSION && ./push_to_repo.sh $USERNAME $PASSWORD'
sh 'cd $PROJECT && git checkout docs_stable && git merge master && ./push_to_repo.sh $USERNAME $PASSWORD'
}
}
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ configure_file(users_guide.dox users_guide.dox COPYONLY)
configure_file(groups.dox groups.dox COPYONLY)
configure_file(mainpage.dox mainpage.dox COPYONLY)
configure_file(namespaces.dox namespaces.dox COPYONLY)
configure_file(index.html index.html COPYONLY)
set_source_files_properties(Doxyfile groups.dox mainpage.dox namespaces.dox users_guide.dox
PROPERTIES GENERATED TRUE)

Expand Down Expand Up @@ -41,7 +42,7 @@ if(NOT WIN32)
endif(NOT WIN32)

add_custom_command(OUTPUT sphinx.stamp
COMMAND sphinx-build -bhtml source build
COMMAND sphinx-build -bhtml source build
COMMAND echo "timestamp" > sphinx.stamp
DEPENDS ${CMAKE_SPHINX_SOURCES} doxygen.stamp capi_coverage
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/doc
Expand All @@ -56,4 +57,3 @@ add_dependencies(html users_guide)
set(CLEANFILES doxygen.stamp sphinx.stamp html latex build)
set_directory_properties(PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES ${CLEANFILES})

10 changes: 10 additions & 0 deletions doc/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=stable/index.html">
<script type="text/javascript"> window.location.href = "stable/index.html" </script>
<title> Page Redirection </title>
</head>
<body>If you are not redirected automatically, follow this <a href='stable/index.html'>link to v:stable</a>.</body>
</html>
2 changes: 2 additions & 0 deletions doc/source/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ author = u'Eugen Wintersberger'
version = u'@PROJECT_VERSION@'
# The full version, including alpha/beta/rc tags.
release = u'@PROJECT_VERSION@'
if release.count('.') == 1:
release = u'(latest)'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
7 changes: 7 additions & 0 deletions doc/source/index.rst.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ Indices and tables
* :ref:`modindex`
* :ref:`search`

Documentation for other h5cpp versions
======================================

`v:latest <../latest/index.html>`_,
`v:stable <../stable/index.html>`_,
`v0.4.1 <../v0.4.1/index.html>`_,
`v0.3.3 <../v0.3.3/index.html>`_