X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=docs%2Fbuild-integration-robot-libdoc.sh;fp=docs%2Fbuild-integration-robot-libdoc.sh;h=1a5568dad013721447da2cf5988ad412f5c809bf;hb=89d8bd3b8f96de73cf2d3fa4084a050835339885;hp=0000000000000000000000000000000000000000;hpb=88c00a7c6acc99bf06900d7f3e33fe8f631e3eb8;p=integration%2Ftest.git diff --git a/docs/build-integration-robot-libdoc.sh b/docs/build-integration-robot-libdoc.sh new file mode 100755 index 0000000000..1a5568dad0 --- /dev/null +++ b/docs/build-integration-robot-libdoc.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# @License EPL-1.0 +############################################################################## +# Copyright (c) 2016 Red Hat, Inc. and others. +# Copyright (c) 2017 The Linux Foundation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +############################################################################## + +CSIT_DIR="../csit/libraries" +ROBOT_DIR="$(pwd)/_static/integration/robot" +TMP_ROBOT_DIR="$(pwd)/_build/robot" + +mkdir -p "$ROBOT_DIR" "$TMP_ROBOT_DIR" + +# --- START BUILD ROBOT DOCS --- # +pushd "$CSIT_DIR" +csit_dirs=($(find . -type d | sed 's#./##')) +csit_files=($(find . -type f -name "*.py" -o -name "*.robot" | sed 's#./##')) + +pushd "$ROBOT_DIR" +mkdir -p ${csit_dirs[*]} +popd +pushd "$TMP_ROBOT_DIR" +mkdir -p ${csit_dirs[*]} +popd + +if hash parallel 2>/dev/null; then + parallel --jobs 200% --halt now,fail=1 python -m robot.libdoc "{}" "$TMP_ROBOT_DIR/{}.html" ::: ${csit_files[*]} +else + for f in "${csit_files[@]}"; do + python -m robot.libdoc "$f" "$TMP_ROBOT_DIR/$f.html" + done +fi +popd +# --- END BUILD ROBOT DOCS --- # + +# --- START BUILD ROBOT INDEX --- # +pushd "$TMP_ROBOT_DIR" +echo "" >> "$ROBOT_DIR/index.html" +popd +# --- END BUILD ROBOT INDEX --- #