Compare commits
No commits in common. "8f50f62a527de0f976e9ea71c69515b7232f39c1" and "96d76b856a739bc69a0bf90a9264981ac0baa482" have entirely different histories.
8f50f62a52
...
96d76b856a
@ -39,6 +39,7 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
|||||||
read_config() {
|
read_config() {
|
||||||
local func="${FUNCNAME[0]}"
|
local func="${FUNCNAME[0]}"
|
||||||
|
|
||||||
|
WORKING_DIRECTORY=${PWD}
|
||||||
CONFIGFILENAME=${CONFIGFILENAME:-'update_psa.conf'}
|
CONFIGFILENAME=${CONFIGFILENAME:-'update_psa.conf'}
|
||||||
|
|
||||||
if ! [ -f "$CONFIGFILENAME" ]; then
|
if ! [ -f "$CONFIGFILENAME" ]; then
|
||||||
@ -50,6 +51,13 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
|||||||
|
|
||||||
local readonly cf="$CONFIGFILENAME"
|
local readonly cf="$CONFIGFILENAME"
|
||||||
|
|
||||||
|
### TODO: wieso wird hier in das verzeichnis gewechselt
|
||||||
|
if cd $WORKING_DIRECTORY ; then
|
||||||
|
log_debug "$func:${LINENO}: cd to $WORKING_DIRECTORY"
|
||||||
|
else
|
||||||
|
log_fatal "$func:${LINENO}: cannot cd to $WORKING_DIRECTORY"
|
||||||
|
fi
|
||||||
|
|
||||||
readonly GIT_SSL_NO_VERIFY="$(cat "$cf" | jq -r .GIT_SSL_NO_VERIFY)"
|
readonly GIT_SSL_NO_VERIFY="$(cat "$cf" | jq -r .GIT_SSL_NO_VERIFY)"
|
||||||
assert_s GIT_SSL_NO_VERIFY
|
assert_s GIT_SSL_NO_VERIFY
|
||||||
|
|
||||||
|
67
update_psa
67
update_psa
@ -25,7 +25,6 @@ if [ -z $IFS ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
MAINTENANCE="NO"
|
MAINTENANCE="NO"
|
||||||
WORKING_DIRECTORY=${PWD}
|
|
||||||
|
|
||||||
# parse commandline parameters
|
# parse commandline parameters
|
||||||
while test $# -gt 0; do
|
while test $# -gt 0; do
|
||||||
@ -68,45 +67,41 @@ while test $# -gt 0; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
source ./update_psa_impl
|
if cd "$WORKING_DIRECTORY"; then
|
||||||
|
source ./update_psa_impl
|
||||||
|
|
||||||
if [ -z "$WORKING_DIRECTORY" ]; then
|
if read_config
|
||||||
log_fatal "update_psa:${LINENO}: empty WORKING_DIRECTORY"
|
then
|
||||||
fi
|
check_default_route
|
||||||
|
check_route_to_repository "185.191.219.134" # git.mimbach.de
|
||||||
|
check_for_running_apism
|
||||||
|
if clone_customer_repository ${CUSTOMER_REPOSITORY_PATH}
|
||||||
|
then
|
||||||
|
check_sanity_of_repository
|
||||||
|
|
||||||
if ! cd "$WORKING_DIRECTORY"; then
|
if [ "$MAINTENANCE" = "NO" ]; then
|
||||||
log_fatal "update_psa:${LINENO}: cannot cd to $WORKING_DIRECTORY"
|
log_info "update_psa:${LINENO}: MAINTENANCE OFF. Checking for updates..."
|
||||||
fi
|
# someone must have activated the WAIT-button in ISMAS.
|
||||||
|
# Request the status of this button in updates_available().
|
||||||
log_info "update_psa:${LINENO}: cd to $WORKING_DIRECTORY"
|
if ! updates_available; then
|
||||||
|
update_psa_false_alarm "update requested, but no WAIT state detected !!!"
|
||||||
if read_config; then
|
log_fatal "update_psa:${LINENO}: update requested, but no WAIT state detected !!!"
|
||||||
check_default_route
|
fi
|
||||||
check_route_to_repository "185.191.219.134" # git.mimbach.de
|
else
|
||||||
check_for_running_apism
|
# simulate an activated WAIT-button
|
||||||
if clone_customer_repository ${CUSTOMER_REPOSITORY_PATH}; then
|
set_updates_available
|
||||||
check_sanity_of_repository
|
while :
|
||||||
|
do
|
||||||
if [ "$MAINTENANCE" = "NO" ]; then
|
sleep 5
|
||||||
log_info "update_psa:${LINENO}: MAINTENANCE OFF. Checking for updates..."
|
updates_available && break
|
||||||
# someone must have activated the WAIT-button in ISMAS.
|
done
|
||||||
# Request the status of this button in updates_available().
|
|
||||||
if ! updates_available; then
|
|
||||||
update_psa_false_alarm "update requested, but no WAIT state detected !!!"
|
|
||||||
log_fatal "update_psa:${LINENO}: update requested, but no WAIT state detected !!!"
|
|
||||||
fi
|
fi
|
||||||
else
|
# updates available
|
||||||
# simulate an activated WAIT-button
|
update_psa
|
||||||
set_updates_available
|
|
||||||
while :
|
|
||||||
do
|
|
||||||
sleep 5
|
|
||||||
updates_available && break
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
# updates available
|
|
||||||
update_psa
|
|
||||||
fi
|
fi
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
exit 0
|
|
||||||
|
exit -1
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
"" : "local branches",
|
"" : "local branches",
|
||||||
"local_branches" : ["master",
|
"local_branches" : ["master",
|
||||||
"zg1/zone1", "zg1/zone2", "zg1/zone3", "zg1/zone4"],
|
"zg1/zone1", "zg1/zone2", "zg1/zone3"],
|
||||||
|
|
||||||
"" : "customer number of PSA",
|
"" : "customer number of PSA",
|
||||||
"customer_id_" : "/etc/cust_nr",
|
"customer_id_" : "/etc/cust_nr",
|
||||||
@ -26,7 +26,7 @@
|
|||||||
"" : "0-index used as size of following array",
|
"" : "0-index used as size of following array",
|
||||||
"" : ".zg[0]: #n of zones_groups",
|
"" : ".zg[0]: #n of zones_groups",
|
||||||
"" : ".zg[1].z[0]: #n of zones in zg[1]",
|
"" : ".zg[1].z[0]: #n of zones in zg[1]",
|
||||||
"zg" : [ 1, { "z" : [ 4, 1, 2, 4] } ],
|
"zg" : [ 1, { "z" : [ 3, 1, 2, 3] } ],
|
||||||
|
|
||||||
"" : "url of customer repository",
|
"" : "url of customer repository",
|
||||||
"cust_repository_path" : "https://git.mimbach49.de/GerhardHoffmann/customer_281.git"
|
"cust_repository_path" : "https://git.mimbach49.de/GerhardHoffmann/customer_281.git"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user