Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script to update all automatically generated documentation #142

Merged
merged 11 commits into from
Jun 29, 2016
81 changes: 81 additions & 0 deletions docs/scripts/update-all-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# #
# Copyright 2015-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (http://www.herculesstichting.be/in_English)
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
#
# http://github.com/hpcugent/easybuild
#
# EasyBuild is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation v2.
#
# EasyBuild is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>.
# #

# This script generates all readthedocs documentation that can be automatically updated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... updates all EasyBuild documentation that can be automatically generated


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add yourself as an author:

# author: ...


#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this the first line


set -eu
framework_path=`python -c "import os; import easybuild; print os.path.dirname(os.path.abspath(easybuild.__file__))"`
vs=version-specific
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to VS_DIR

scripts_dir=scripts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use upper case for constants: SCRIPTS_DIR


if [ ! -d $vs ]; then
echo "version-specific dir does not exits"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exist (typo)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redirect to stderr with >&2 at the end

exit 1
fi

if [ ! -d $scripts_dir ]; then
echo "scripts dir does not exist"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redirect to stderr with >&2 at the end

exit 1
fi

generate_api_script=$scripts_dir/generate_api.py
generic_easyblocks_script=$scripts_dir/generic_easyblocks.py

if [ ! -f $generate_api_script -a -f $generic_easyblocks_script ]; then
exit 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no error msg?

fi

# api docs
python $generate_api_script -m $framework_path

# generic easyblocks doc
python $generic_easyblocks_script

# help doc
eb --help=rst > $vs/generated_configuration_options.rst

# available easyconfig params
eb -a --output-format rst > $vs/generated_ec_params.rst

# available configfile constants
eb --avail-cfgfile-constants --output-format rst > $vs/generated_cfgfile_constants.rst

# available easyconfig constants
eb --avail-easyconfig-constants --output-format rst > $vs/generated_ec_constants.rst

# available easyconfig licenses
eb --avail-easyconfig-licenses --output-format rst > $vs/generated_ec_licenses.rst

# available easyconfig templates
eb --avail-easyconfig-templates --output-format rst > $vs/generated_ec_templates.rst

# list-easyblocks doc
eb --list-easyblocks --output-format rst > version-specific/generated_list_easyblocks.rst

# list-toolchain doc
eb --list-toolchains --output-format rst > version-specific/generated_list_toolchains.rst