Skip to content

Commit

Permalink
Add pipeline for publishing documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
  • Loading branch information
k0ekk0ek committed Jun 25, 2021
1 parent b33a45c commit 624da66
Showing 1 changed file with 102 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .azure/publish-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#
# Copyright(c) 2021 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#

#
# Template with basic build and test instructions to be included by pipelines.
#

trigger:
tags:
include:
- '*'
branches:
include:
- 'master'
- 'releases/*'
pr: none

pool:
vmImage: ubuntu-20.04

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
name: install_python
# Set defaults from steps to share them among pipelines
- bash: |
[[ -n "${ARCH}" ]] || \
echo "###vso[task.setvariable variable=arch;]x86_64"
[[ -n "${BUILD_TYPE}" ]] || \
echo "###vso[task.setvariable variable=build_type;]Debug"
echo "###vso[task.setvariable variable=pip_cache;]${HOME}/.cache/pip"
echo "###vso[task.setvariable variable=conan_cache;]${HOME}/.conan/data"
echo "###vso[task.setvariable variable=PATH;]$(python3 -m site --user-base)/bin:${PATH}"
sudo apt-get install -y doxygen
condition: eq(variables['Agent.OS'], 'Linux')
name: setup_linux
- task: Cache@2
inputs:
key: pip | 2 | $(Agent.OS)
path: $(pip_cache)
name: cache_pip
- task: Cache@2
inputs:
key: conan | 2 | $(Agent.OS) | $(arch) | $(build_type)
path: $(conan_cache)
name: cache_conan
- bash: |
set -e -x
pip install conan sphinx breathe exhale sphinx-rtd-theme --user --upgrade
conan profile new default --detect
name: install_conan
- bash: |
set -e -x
conan profile update settings.compiler.libcxx=libstdc++11 default
condition: eq(variables['Agent.OS'], 'Linux')
name: update_conan_cxx_library
- bash: |
set -e -x
git clone --single-branch \
--branch "${CYCLONEDDS_BRANCH:-master}" \
"${CYCLONEDDS_REPOSITORY:-https://github.com/eclipse-cyclonedds/cyclonedds.git}" \
cyclonedds
mkdir cyclonedds/build
cd cyclonedds/build
conan install -b missing -s arch=${ARCH} -s build_type=${BUILD_TYPE} ..
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=install \
-DSANITIZER=${SANITIZER:-none} \
${GENERATOR:+-G} "${GENERATOR}" -A "${PLATFORM}" -T "${TOOLSET}" ..
cmake --build . --config ${BUILD_TYPE} --target install -- ${BUILD_TOOL_OPTIONS}
name: install_cyclonedds
- bash: |
set -e -x
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH=${BUILD_SOURCESDIRECTORY}/cyclonedds/build/install \
-DBUILD_DOCS=on \
..
cmake --build . --target docs
name: build_documentation
- bash: |
set -e -x
version="$(echo ${BUILD_SOURCEBRANCHNAME} | sed -n -E 's#^.*[vV]?([0-9]+\.[0-9]+)\.[0-9]+((alpha|beta|rc)[0-9]*)?$#\1#p')"
if [ -z "${version}" ]; then
version="latest"
fi
echo "###vso[task.setvariable variable=version;]${version}"
name: figure_version
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: build/docs/docs
artifactName: 'cyclonedds-cxx-docs-$(version)'

0 comments on commit 624da66

Please sign in to comment.