Skip to content

Commit

Permalink
Merge branch 'feature/linuxDocsBuilder' into v3_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dacuster committed Oct 15, 2024
2 parents 0798a32 8563191 commit afac01c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 22,8 @@ RUN set -ex \
zlib1g-dev \
subversion \
build-essential \
bash-completion
bash-completion \
doxygen

# Add a user that will be used when shelling into this container and allow them to use devices
ARG USER_ID=1000
Expand Down
33 changes: 26 additions & 7 deletions .devcontainer/docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 8,7 @@ set -e
# Get some arguments from the user
os="ubuntu"
arch="amd64"
build_docs=false
while [[ $# -gt 0 ]]; do
case $1 in
--os)
Expand All @@ -20,6 21,10 @@ while [[ $# -gt 0 ]]; do
shift # past argument
shift # past value
;;
--docs)
build_docs=true
shift # past argument
;;
*)
shift # past argument
;;
Expand All @@ -31,9 36,15 @@ script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
project_dir="${script_dir}/.."
docker_project_dir="/home/microstrain/mipsdk"
dockerfile="${script_dir}/Dockerfile.${os}"
build_dir_name="build_${os}_${arch}"

image_name="microstrain/mipsdk_${os}_builder:${arch}"
if [ ${build_docs} = true ]; then
build_dir_name="build_docs"
image_name="microstrain/mipsdk_docs_builder:${arch}"
else
build_dir_name="build_${os}_${arch}"
image_name="microstrain/mipsdk_${os}_builder:${arch}"
fi


# Build the docker image
docker build \
Expand All @@ -49,6 60,17 @@ if [ "${ISHUDSONBUILD}" != "True" ]; then
docker_it_flags="-it"
fi

if [ ${build_docs} = true ]; then
configure_flags="-DMICROSTRAIN_BUILD_DOCUMENTATION=ON"
build_target="package_docs"
else
configure_flags="\
-DMICROSTRAIN_BUILD_EXAMPLES=ON \
-DMICROSTRAIN_BUILD_PACKAGE=ON \
-DCMAKE_BUILD_TYPE=RELEASE"
build_target="package"
fi

# Run the build in the docker image
docker run \
--rm \
Expand All @@ -61,10 83,7 @@ docker run \
rm -rf ${docker_project_dir}/${build_dir_name}; \
mkdir ${docker_project_dir}/${build_dir_name}; \
cd ${docker_project_dir}/${build_dir_name}; \
cmake ${docker_project_dir} \
-DMICROSTRAIN_BUILD_EXAMPLES=ON \
-DMICROSTRAIN_BUILD_PACKAGE=ON \
-DCMAKE_BUILD_TYPE=RELEASE; \
cmake ${docker_project_dir} ${configure_flags}; \
cmake --build . -j$(nproc); \
cmake --build . --target package; \
cmake --build . --target ${build_target}; \
"
9 changes: 2 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 39,7 @@ pipeline {
// Run all the builds in parallel
parallel {
stage('Documentation') {
agent { label 'windows10' }
agent { label 'linux-amd64' }
options {
skipDefaultCheckout()
timeout(time: 5, activity: true, unit: 'MINUTES')
Expand All @@ -48,12 48,7 @@ pipeline {
script {
checkoutRepo()
env.setProperty('BRANCH_NAME', branchName())
powershell """
mkdir build_docs
cd build_docs
cmake .. -DMICROSTRAIN_BUILD_DOCUMENTATION=ON
cmake --build . --target package_docs
"""
sh "./.devcontainer/docker_build.sh --docs"
archiveArtifacts artifacts: 'build_docs/mipsdk_*'
}
}
Expand Down

0 comments on commit afac01c

Please sign in to comment.