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

user guide: infrastructure #5

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc
@@ -0,0 +1,3 @@
{
"extends": "eslint:recommended"
}
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -3,5 +3,5 @@
etc/rose.conf
etc/opt
lib/bash/rose_init_site
doc/sphinx/_build
doc
venv
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -22,13 +22,14 @@ install:
- sudo apt-get install -y libxml-parser-perl libconfig-inifiles-perl
- sudo apt-get install -y libdbi-perl libdbd-sqlite3-perl
- sudo apt-get install python-pip python-dev graphviz libgraphviz-dev python-jinja2 python-sqlalchemy
- pip install cherrypy Jinja2 requests simplejson sqlalchemy
- pip install cherrypy Jinja2 requests simplejson sqlalchemy pyopenssl
- pip install pygraphviz --install-option="--include-path=/usr/include/graphviz" --install-option="--library-path=/usr/lib/graphviz/"
- pip install pep8
- sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu `lsb_release -cs` svn19" >> /etc/apt/sources.list.d/subversion19.list'
- sudo wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -
- sudo apt-get update
- sudo apt-get install -y subversion
- npm install -g eslint

script:
- rose test-battery --state=save -j 5 || (echo -e "\n\nRerunning Failed Tests...\n\n"; rose test-battery --state=save,failed -j 5)
27 changes: 27 additions & 0 deletions bin/rose
Expand Up @@ -151,6 +151,33 @@ version|--version|-V)
print_version
exit
:;;
doc)
PATH=$(path_lead "${PATH:-}" "$ROSE_HOME_BIN")
PYTHONPATH=$(path_lead "${PYTHONPATH:-}" "$ROSE_HOME/lib/python")
ROSE_UTIL=$UTIL
export PATH PYTHONPATH ROSE_UTIL
let ns_len=${#ROSE_NS}+2
for U in $(cd $ROSE_HOME_BIN && ls $ROSE_NS-*); do
NAME=$(sed "s/^$ROSE_NS-\\(.*\\)\$/\1/" <<<$U)
ALIAS=$(get_alias $NAME)
if [[ -n $ALIAS ]]; then
echo '=================================================='
echo "${ROSE_NS} ${NAME} -> ${ROSE_NS} ${ALIAS}"
echo '=================================================='
echo
else

echo '=================================================='
echo "$ROSE_NS $NAME"
echo '=================================================='
echo
PAGER=cat

Choose a reason for hiding this comment

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

Does this need export?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Apparently not...

help_util $(cut -c "${ns_len}-" <<<"${U}")
echo
fi
done
exit 0
:;;
esac

COMMAND=$(dirname $0)/$ROSE_NS-$UTIL
Expand Down
55 changes: 30 additions & 25 deletions bin/rose-app-run
Expand Up @@ -18,51 +18,56 @@
# along with Rose. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
# NAME
# rose-app-run
# rose app-run
#
# SYNOPSIS
# rose app-run [OPTIONS] [--] [COMMAND ...]
#
# DESCRIPTION
# Run an application according to its configuration.
#
# May run a builtin application (if the "mode" setting in the configuration
# May run a builtin application (if the `mode` setting in the configuration
# specifies the name of a builtin application) or a command.
#
# Determine the command to run in this order:
# 1. If COMMAND is specified, invoke the command.
# 2. If the --command-key=KEY option is defined, invoke the command
# specified in [command]KEY.
# 3. If the ROSE_APP_COMMAND_KEY environment variable is set, the command
# specified in the [command]KEY setting in the application configuration
# whose KEY matches it is used.
# 4. If the environment variable ROSE_TASK_NAME is defined and a setting in
# the [command] section has a key matching the value of the environment
# variable, then the value of the setting is used as the command.
# 5. Invoke the command specified in [command]default.
#
# 1. If `COMMAND` is specified, invoke the command.
# 2. If the `--command-key=KEY` option is defined, invoke the command
# specified in `[command]KEY`.
# 3. If the `ROSE_APP_COMMAND_KEY` environment variable is set, the command
# specified in the `[command]KEY` setting in the application
# configuration whose `KEY` matches it is used.
# 4. If the environment variable `ROSE_TASK_NAME` is defined and a setting
# in the `[command]` section has a key matching the value of the
# environment variable, then the value of the setting is used as the
# command.
# 5. Invoke the command specified in `[command]default`.
#
# OPTIONS
# --app-mode=MODE
# Run a builtin application identified by MODE. The default MODE is
# "command".
# Run a builtin application identified by `MODE`. The default `MODE` is
# `command`.
# --config=DIR, -C DIR
# Specify the configuration directory of the application. (default=$PWD)
# Specify the configuration directory of the application.
# (default=`$PWD`)
# --command-key=KEY, -c KEY
# Invoke the command specified in [command]KEY.
# Invoke the command specified in `[command]KEY`.
# --define=[SECTION]KEY=VALUE, -D [SECTION]KEY=VALUE
# Each of these overrides the [SECTION]KEY setting with a given VALUE.
# Can be used to disable a setting using the syntax --define=[SECTION]!KEY
# or even --define=[!SECTION].
# Each of these overrides the `[SECTION]KEY` setting with a given
# `VALUE`.
# Can be used to disable a setting using the syntax
# `--define=[SECTION]!KEY` or even `--define=[!SECTION]`.
# --install-only, -i
# Install files only. Do not invoke the run.
# --new, -N
# Remove all items in $PWD before doing anything. This option only
# works with the --config=DIR option and if $PWD is not DIR.
# Remove all items in `$PWD` before doing anything. This option only
# works with the `--config=DIR` option and if `$PWD` is not `DIR`.
# --no-overwrite
# Do not overwrite existing files.
# --opt-conf-key=KEY, -O KEY, --opt-conf-key='(KEY)', -O '(KEY)'
# Each of these switches on an optional configuration identified by KEY.
# The configurations are applied first-to-last. The '(KEY)' syntax
# Each of these switches on an optional configuration identified by
# `KEY`.
# The configurations are applied first-to-last. The `(KEY)` syntax
# denotes an optional configuration that can be missing. Otherwise, the
# optional configuration must exist.
# --quiet, -q
Expand All @@ -72,9 +77,9 @@
#
# ENVIRONMENT VARIABLES
# optional ROSE_APP_COMMAND_KEY
# Switch to a particular command specified in [command]KEY
# Switch to a particular command specified in `[command]KEY`.
# optional ROSE_APP_OPT_CONF_KEYS
# Each KEY in this space delimited list switches on an optional
# Each `KEY` in this space delimited list switches on an optional
# configuration. The configurations are applied first-to-last.
# optional ROSE_FILE_INSTALL_ROOT
# If specified, change to the specified directory to install files.
Expand Down
17 changes: 9 additions & 8 deletions bin/rose-app-upgrade
Expand Up @@ -3,7 +3,7 @@
# (C) Crown copyright Met Office. All rights reserved.
#-------------------------------------------------------------------------------
# NAME
# rose-app-upgrade
# rose app-upgrade
#
# SYNOPSIS
# rose app-upgrade [OPTIONS] [VERSION]
Expand All @@ -12,8 +12,9 @@
# Upgrade an application configuration using metadata upgrade macros.
#
# Alternatively, show the available upgrade/downgrade versions:
# "=" indicates the current version.
# "*" indicates the default version to change to.
#
# * `=` indicates the current version.
# * `*` indicates the default version to change to.
#
# If an application contains optional configurations, loop through
# each one, combine with the main, upgrade it, and re-create it as
Expand All @@ -23,11 +24,11 @@
# --all-versions, -a
# Use all tagged versions.
# --config=DIR, -C DIR
# Use configuration in DIR instead of $PWD.
# Use configuration in `DIR` instead of `$PWD`.
# --downgrade, -d
# Downgrade the version instead of upgrade.
# --meta-path=PATH, -M PATH
# Prepend PATH to the metadata search path. (look here first).
# Prepend `PATH` to the metadata search path. (look here first).
# This option can be used repeatedly to load multiple paths.
# --non-interactive, --yes, -y
# Switch off interactive prompting.
Expand All @@ -40,12 +41,12 @@
# ARGUMENTS
# VERSION
# A version to change to. If no version is specified, show available
# versions. If --non-interactive is used, use the latest version
# available. If --non-interactive and --downgrade are used, use
# versions. If `--non-interactive` is used, use the latest version
# available. If `--non-interactive` and `--downgrade` are used, use
# the earliest version available.
#
# ENVIRONMENT VARIABLES
# optional ROSE_META_PATH
# Prepend $ROSE_META_PATH to the metadata search path.
# Prepend `$ROSE_META_PATH` to the metadata search path.
#-------------------------------------------------------------------------------
exec python -m rose.upgrade "$@"
2 changes: 1 addition & 1 deletion bin/rose-bush
Expand Up @@ -29,7 +29,7 @@
# DESCRIPTION
# Start/stop ad-hoc Rose Bush web service server.
#
# For "rose bush start", if PORT is not specified, use port 8080.
# For `rose bush start`, if `PORT` is not specified, use port 8080.
#
# Rose Bush is a web service for browsing users' Rose suite logs via an
# HTTP interface.
Expand Down