TT#44854 Add option --ignore-shared-storage-check for "build" and "check"

This is necessary when the HA_INT addresses are being changed, the communication
is not possible in that scenario.

Change-Id: I658a4f40e4f5b13d6ac224978999789728d8b915
changes/01/27901/3
Manuel Montecelo 6 years ago
parent e67cb4cfdc
commit 6b833f7f31

@ -285,15 +285,18 @@ provides useful information.
The *--force-all-services* option causes all services to be restarted, including
services without changes in config files.
**check** [--ignore-branch-check] [<config_files_or_directories>|<pattern>]::
**check** [--ignore-branch-check] [--ignore-shared-storage-check] [<config_files_or_directories>|<pattern>]::
Check syntax of YAML files and validate schema before performing any further actions.
The *--ignore-branch-check* option doesn't fail the check if the
current active branch doesn't match 'master'.
The option *--ignore-shared-storage-check* can be used to skip check of shared
storage, for example in situations like when the HA_INT addresses are being
changed, because the communication is not possible in that scenario.
In the High Availability setup possibly outstanding pull actions are
checked as well.
**build** [--ignore-branch-check] [--modified-only] [<files_or_directories>|<pattern>]::
**build** [--ignore-branch-check] [--ignore-shared-storage-check] [--modified-only] [<files_or_directories>|<pattern>]::
Generate configuration files, based on values defined the central yml files and
based on the templates in the configuration tree (/etc/ngcp-config/templates by
@ -302,6 +305,10 @@ _check_ action. The *--modified-only* option checks for _modified_ and _uncommit
configuration files (central yml files and templates) and builds the relevant
files only. The *--ignore-branch-check* option doesn't fail the build if the
current active branch doesn't match 'master'.
The option *--ignore-shared-storage-check* can be used to pass down to the
"check" subcommand in order to skip check of shared storage, for example in
situations like when the HA_INT addresses are being changed, because the
communication is not possible in that scenario.
If a central yml file is modified it builds all configuration files.
If changes are in template files only just the according template files are
considered for rebuild. If a file (e.g. _/etc/rsyslog.conf_) or directory (e.g.

@ -19,22 +19,19 @@ fi
. "${FUNCTIONS}"/main
MODIFIED_ONLY=false
CHECK_BRANCH=true
check_args=()
if [ -n "${1:-}" ] ; then
case "$1" in
*--modified-only*) MODIFIED_ONLY=true ; shift ;;
*--ignore-branch-check*) CHECK_BRANCH=false ; shift ;;
*--ignore-branch-check*) check_args+=( --ignore-branch-check ) ; shift ;;
*--ignore-shared-storage-check*) check_args+=( --ignore-shared-storage-check ) ; shift ;;
esac
fi
# Sanity check the YAML and schema files.
# NOTE: we can't blindly pass "$@" to the check script,
# so explicitly check and add option as needed
if "$CHECK_BRANCH" ; then
"${SCRIPTS}"/check
else
"${SCRIPTS}"/check --ignore-branch-check
fi
"${SCRIPTS}"/check "${check_args[@]}"
"${SCRIPTS}"/patch "$@"

@ -19,13 +19,16 @@ fi
usage() {
printf "ngcpcfg build -- supported command line options:
--ignore-branch-check - do not fail build if branch doesn't match 'master'\n\n"
--ignore-branch-check - do not fail build if branch doesn't match 'master'
--ignore-shared-storage-check - skip check of shared storage\n\n"
}
CHECK_BRANCH=true
CHECK_SHARED_STORAGE=true
while [ -n "${1:-}" ] ; do
case "$1" in
*--ignore-branch-check*) CHECK_BRANCH=false ; shift ;;
*--ignore-shared-storage-check*) CHECK_SHARED_STORAGE=false ; shift ;;
*--help*) usage ; exit 0 ;;
*) break ;;
esac
@ -192,6 +195,11 @@ check_configs_conflicts() {
}
check_shared_storage() {
if ! ${CHECK_SHARED_STORAGE} ; then
log_info "Option --ignore-shared-storage-check is enabled, skipping."
return 0
fi
# ensure there are no outstanding pull actions,
# unless --no-action-failure is used (ignore then)
if ! type -p execute_check_shared_storage &>/dev/null ; then

Loading…
Cancel
Save