Compare commits

...

3 Commits

3 changed files with 42 additions and 45 deletions

View File

@ -39,7 +39,6 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
read_config() {
local func="${FUNCNAME[0]}"
WORKING_DIRECTORY=${PWD}
CONFIGFILENAME=${CONFIGFILENAME:-'update_psa.conf'}
if ! [ -f "$CONFIGFILENAME" ]; then
@ -51,13 +50,6 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
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)"
assert_s GIT_SSL_NO_VERIFY

View File

@ -25,6 +25,7 @@ if [ -z $IFS ]; then
fi
MAINTENANCE="NO"
WORKING_DIRECTORY=${PWD}
# parse commandline parameters
while test $# -gt 0; do
@ -67,16 +68,23 @@ while test $# -gt 0; do
shift
done
if cd "$WORKING_DIRECTORY"; then
source ./update_psa_impl
if read_config
then
if [ -z "$WORKING_DIRECTORY" ]; then
log_fatal "update_psa:${LINENO}: empty WORKING_DIRECTORY"
fi
if ! cd "$WORKING_DIRECTORY"; then
log_fatal "update_psa:${LINENO}: cannot cd to $WORKING_DIRECTORY"
fi
log_info "update_psa:${LINENO}: cd to $WORKING_DIRECTORY"
if read_config; then
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
if clone_customer_repository ${CUSTOMER_REPOSITORY_PATH}; then
check_sanity_of_repository
if [ "$MAINTENANCE" = "NO" ]; then
@ -101,7 +109,4 @@ if cd "$WORKING_DIRECTORY"; then
fi
fi
exit 0
fi
exit -1
###############################################################################

View File

@ -13,7 +13,7 @@
"" : "local branches",
"local_branches" : ["master",
"zg1/zone1", "zg1/zone2", "zg1/zone3"],
"zg1/zone1", "zg1/zone2", "zg1/zone3", "zg1/zone4"],
"" : "customer number of PSA",
"customer_id_" : "/etc/cust_nr",
@ -26,7 +26,7 @@
"" : "0-index used as size of following array",
"" : ".zg[0]: #n of zones_groups",
"" : ".zg[1].z[0]: #n of zones in zg[1]",
"zg" : [ 1, { "z" : [ 3, 1, 2, 3] } ],
"zg" : [ 1, { "z" : [ 4, 1, 2, 4] } ],
"" : "url of customer repository",
"cust_repository_path" : "https://git.mimbach49.de/GerhardHoffmann/customer_281.git"