|
| 1 | +#!/bin/bash |
| 2 | +## |
| 3 | +# Copyright 2015-2016 Ghent University |
| 4 | +# |
| 5 | +# This file is part of EasyBuild, |
| 6 | +# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), |
| 7 | +# with support of Ghent University (http://ugent.be/hpc), |
| 8 | +# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), |
| 9 | +# the Hercules foundation (http://www.herculesstichting.be/in_English) |
| 10 | +# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). |
| 11 | +# |
| 12 | +# http://github.com/hpcugent/easybuild |
| 13 | +# |
| 14 | +# EasyBuild is free software: you can redistribute it and/or modify |
| 15 | +# it under the terms of the GNU General Public License as published by |
| 16 | +# the Free Software Foundation v2. |
| 17 | +# |
| 18 | +# EasyBuild is distributed in the hope that it will be useful, |
| 19 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | +# GNU General Public License for more details. |
| 22 | +# |
| 23 | +# You should have received a copy of the GNU General Public License |
| 24 | +# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. |
| 25 | +## |
| 26 | + |
| 27 | +# This script generates all readthedocs documentation that can be automatically updated. |
| 28 | +# |
| 29 | +# authors: Caroline De Brouwer, Kenneth Hoste (HPC-UGent) |
| 30 | + |
| 31 | +set -eu |
| 32 | + |
| 33 | +VERSION_SPECIFIC_DIR='version-specific' |
| 34 | +SCRIPTS_DIR='scripts' |
| 35 | + |
| 36 | +if [[ $PWD =~ "easybuild/docs$" ]]; then |
| 37 | + echo "script should be run from easybuild/docs" |
| 38 | + exit 1 |
| 39 | +fi |
| 40 | + |
| 41 | +if [ ! -d $VERSION_SPECIFIC_DIR ]; then |
| 42 | + echo "version-specific dir does not exits" |
| 43 | + exit 1 |
| 44 | +fi |
| 45 | + |
| 46 | +if [ ! -d $SCRIPTS_DIR ]; then |
| 47 | + echo "scripts dir does not exist" |
| 48 | + exit 1 |
| 49 | +fi |
| 50 | + |
| 51 | +generate_api_script=$SCRIPTS_DIR/gen_api_docs.py |
| 52 | +generic_easyblocks_script=$SCRIPTS_DIR/gen_easyblocks_docs.py |
| 53 | + |
| 54 | +if [ ! -f $generate_api_script -a -f $generic_easyblocks_script ]; then |
| 55 | + echo "Could not find all required scripts: $generate_api_script, $generic_easyblocks_script" >&2 |
| 56 | + exit 1 |
| 57 | +fi |
| 58 | + |
| 59 | +# api docs |
| 60 | +python $generate_api_script |
| 61 | + |
| 62 | +# generic easyblocks doc |
| 63 | +echo ".. _generic_easyblocks:" > $VERSION_SPECIFIC_DIR/generic_easyblocks.rst |
| 64 | +echo "" >> $VERSION_SPECIFIC_DIR/generic_easyblocks.rst |
| 65 | +python $generic_easyblocks_script >> $VERSION_SPECIFIC_DIR/generic_easyblocks.rst |
| 66 | + |
| 67 | +# help doc |
| 68 | +echo ".. _eb_help:" > $VERSION_SPECIFIC_DIR/help.rst |
| 69 | +echo "*(see also* \`\`eb --help\`\` *)*" >> $VERSION_SPECIFIC_DIR/help.rst |
| 70 | +echo >> $VERSION_SPECIFIC_DIR/help.rst |
| 71 | +eb --help=rst >> $VERSION_SPECIFIC_DIR/help.rst |
| 72 | + |
| 73 | +# available easyconfig params |
| 74 | +echo ".. _avail_easyconfig_params:" > $VERSION_SPECIFIC_DIR/easyconfig_parameters.rst |
| 75 | +echo "*(see also* \`\`eb -a\`\` or \`\`eb --avail-easyconfig-params\`\` *)*" > $VERSION_SPECIFIC_DIR/easyconfig_parameters.rst |
| 76 | +echo >> $VERSION_SPECIFIC_DIR/easyconfig_parameters.rst |
| 77 | +eb -a --output-format rst >> $VERSION_SPECIFIC_DIR/easyconfig_parameters.rst |
| 78 | + |
| 79 | +# available configfile constants |
| 80 | +echo ".. _avail_cfgfile_constants:" > $VERSION_SPECIFIC_DIR/config_file_constants.rst |
| 81 | +echo "*(see also* \`\`eb --avail-cfgfile-constants\`\` *)*" >> $VERSION_SPECIFIC_DIR/config_file_constants.rst |
| 82 | +echo >> $VERSION_SPECIFIC_DIR/config_file_constants.rst |
| 83 | +eb --avail-cfgfile-constants --output-format rst >> $VERSION_SPECIFIC_DIR/config_file_constants.rst |
| 84 | + |
| 85 | +# available easyconfig constants |
| 86 | +echo ".. _avail_easyconfig_constants:" > $VERSION_SPECIFIC_DIR/easyconfig_constants.rst |
| 87 | +echo "*(see also* \`\`eb --avail-easyconfig-constants\`\` *)*" >> $VERSION_SPECIFIC_DIR/easyconfig_constants.rst |
| 88 | +echo >> $VERSION_SPECIFIC_DIR/easyconfig_constants.rst |
| 89 | +eb --avail-easyconfig-constants --output-format rst >> $VERSION_SPECIFIC_DIR/easyconfig_constants.rst |
| 90 | + |
| 91 | +# available easyconfig licenses |
| 92 | +echo ".. _avail_easyconfig_licenses:" > $VERSION_SPECIFIC_DIR/easyconfig_license_constants.rst |
| 93 | +echo "*(see also* \`\`eb --avail-easyconfig-licenses\`\` *)*" >> $VERSION_SPECIFIC_DIR/easyconfig_license_constants.rst |
| 94 | +echo >> $VERSION_SPECIFIC_DIR/easyconfig_license_constants.rst |
| 95 | +eb --avail-easyconfig-licenses --output-format rst >> $VERSION_SPECIFIC_DIR/easyconfig_license_constants.rst |
| 96 | + |
| 97 | +# available easyconfig templates |
| 98 | +echo ".. _avail_easyconfig_templates" > $VERSION_SPECIFIC_DIR/easyconfig_templates.rst |
| 99 | +echo "*(see also* \`\`eb --avail-easyconfig-templates\`\` *)*" >> $VERSION_SPECIFIC_DIR/easyconfig_templates.rst |
| 100 | +echo >> $VERSION_SPECIFIC_DIR/easyconfig_templates.rst |
| 101 | +eb --avail-easyconfig-templates --output-format rst >> $VERSION_SPECIFIC_DIR/easyconfig_templates.rst |
| 102 | + |
| 103 | +# list-easyblocks doc |
| 104 | +echo ".. _list_easyblocks:" > $VERSION_SPECIFIC_DIR/easyblocks.rst |
| 105 | +echo "*(see also* \`\`eb --list-easyblocks\`\` and :ref:\`generic_easyblocks\` *)*" >> $VERSION_SPECIFIC_DIR/easyblocks.rst |
| 106 | +echo >> $VERSION_SPECIFIC_DIR/easyblocks.rst |
| 107 | +eb --list-easyblocks --output-format rst >> $VERSION_SPECIFIC_DIR/easyblocks.rst |
| 108 | + |
| 109 | +# list-toolchain doc |
| 110 | +echo ".. _list_toolchains:" > $VERSION_SPECIFIC_DIR/toolchains.rst |
| 111 | +echo "*(see also* \`\`eb --list-toolchains\`\` *)*" >> $VERSION_SPECIFIC_DIR/toolchains.rst |
| 112 | +echo >> $VERSION_SPECIFIC_DIR/toolchains.rst |
| 113 | +eb --list-toolchains --output-format rst >> $VERSION_SPECIFIC_DIR/toolchains.rst |
0 commit comments