Compare commits
3 Commits
a884019431
...
e941af6420
Author | SHA1 | Date | |
---|---|---|---|
e941af6420 | |||
4b6723b8e6 | |||
ec660a9fad |
@ -362,7 +362,7 @@ if [ ${news_to_ismas_sourced:-1} = "1" ]; then # include only once
|
|||||||
\"RESULTCODE\" : ${p[2]},
|
\"RESULTCODE\" : ${p[2]},
|
||||||
\"STEP\" : \"update_psa_${p[3]}\",
|
\"STEP\" : \"update_psa_${p[3]}\",
|
||||||
\"STEP_RESULT\" : \"${p[4]}\",
|
\"STEP_RESULT\" : \"${p[4]}\",
|
||||||
\"VERSION\" : \"${p[5]}\"
|
\"VERSION\" : \"$VERSION\"
|
||||||
}
|
}
|
||||||
}"
|
}"
|
||||||
log_debug "$func:${LINENO}: data=$data"
|
log_debug "$func:${LINENO}: data=$data"
|
||||||
@ -378,7 +378,8 @@ if [ ${news_to_ismas_sourced:-1} = "1" ]; then # include only once
|
|||||||
local data="#M=APISM#C=CMD_SENDVERSION#J=
|
local data="#M=APISM#C=CMD_SENDVERSION#J=
|
||||||
{
|
{
|
||||||
\"VERSION_INFO\" : {
|
\"VERSION_INFO\" : {
|
||||||
\"CREATED\":\"$(date +%Y-%m-%dT%T)\"
|
\"CREATED\":\"$(date +%Y-%m-%dT%T)\",
|
||||||
|
\"HASH\":\"$(compute_hash)\"
|
||||||
},
|
},
|
||||||
\"TARIFF\": {
|
\"TARIFF\": {
|
||||||
$(<$TARIFF_CURRENT_FULL)
|
$(<$TARIFF_CURRENT_FULL)
|
||||||
@ -429,10 +430,10 @@ if [ ${news_to_ismas_sourced:-1} = "1" ]; then # include only once
|
|||||||
|
|
||||||
# if [ $EXITCODE -eq $RC_SUCCESS ]; then
|
# if [ $EXITCODE -eq $RC_SUCCESS ]; then
|
||||||
update_psa_update_succeeded $UPDATE_SUCCEEDED \
|
update_psa_update_succeeded $UPDATE_SUCCEEDED \
|
||||||
$RC_SUCCESS "psa update succeeded"
|
$RC_SUCCESS "psa update succeeded" $VERSION
|
||||||
|
|
||||||
update_psa_update_succeeded $UPDATE_ACTIVATED \
|
update_psa_update_succeeded $UPDATE_ACTIVATED \
|
||||||
$RC_SUCCESS "psa update activated"
|
$RC_SUCCESS "psa update activated" $VERSION
|
||||||
|
|
||||||
log_info "$func:${LINENO}: success"
|
log_info "$func:${LINENO}: success"
|
||||||
# fi
|
# fi
|
||||||
|
21
read_config
21
read_config
@ -7,6 +7,10 @@ source ./general_utils
|
|||||||
if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||||
readonly read_config_sourced=${BASH_SOURCE[0]}
|
readonly read_config_sourced=${BASH_SOURCE[0]}
|
||||||
|
|
||||||
|
readonly MAJOR="0"
|
||||||
|
readonly MINOR="1"
|
||||||
|
readonly PATCH="0"
|
||||||
|
|
||||||
readonly DATEFLAGS="+%Y.%m.%dT%H.%M.%S"
|
readonly DATEFLAGS="+%Y.%m.%dT%H.%M.%S"
|
||||||
readonly STRIPCOMMENTS='sed -e s/#.*$//g'
|
readonly STRIPCOMMENTS='sed -e s/#.*$//g'
|
||||||
readonly STRIPWHITESPACE='sed -E -e s/^[[:space:]]*$//g'
|
readonly STRIPWHITESPACE='sed -E -e s/^[[:space:]]*$//g'
|
||||||
@ -19,8 +23,6 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
|||||||
readonly UPDATEPSAEND=./.updatepsa/end
|
readonly UPDATEPSAEND=./.updatepsa/end
|
||||||
|
|
||||||
readonly PROGRAM=`basename $0`
|
readonly PROGRAM=`basename $0`
|
||||||
readonly VERSION="0.8.0"
|
|
||||||
|
|
||||||
readonly WORKSPACE_DIR=workspace
|
readonly WORKSPACE_DIR=workspace
|
||||||
|
|
||||||
WORKING_DIRECTORY=${WORKING_DIRECTORY:-$UPDATEPSAHOME}
|
WORKING_DIRECTORY=${WORKING_DIRECTORY:-$UPDATEPSAHOME}
|
||||||
@ -84,11 +86,23 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
|||||||
readonly ZONE_GROUPS=(${__zone_groups[@]})
|
readonly ZONE_GROUPS=(${__zone_groups[@]})
|
||||||
assert_a ZONE_GROUPS
|
assert_a ZONE_GROUPS
|
||||||
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
###############################################################################
|
###############################################################################
|
||||||
########################## parsing with jq finished ###########################
|
########################## parsing with jq finished ###########################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
compute_hash () {
|
||||||
|
# TODO: wie genau soll der hash-wert berechnet werden ?
|
||||||
|
HASH="12345abc"
|
||||||
|
# HASH_="67890def"
|
||||||
|
echo $HASH
|
||||||
|
}
|
||||||
|
|
||||||
|
compute_version () {
|
||||||
|
VERSION="$MAJOR.$MINOR.$PATCH+$CUSTOMER_LOCATION-$(compute_hash)"
|
||||||
|
}
|
||||||
|
|
||||||
check_sanity_of_repository () {
|
check_sanity_of_repository () {
|
||||||
local func="${FUNCNAME[0]}"
|
local func="${FUNCNAME[0]}"
|
||||||
|
|
||||||
@ -268,6 +282,9 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
|||||||
done
|
done
|
||||||
log_debug "sanity of ${CUSTOMER_REPOSITORY_PATH} OK"
|
log_debug "sanity of ${CUSTOMER_REPOSITORY_PATH} OK"
|
||||||
|
|
||||||
|
# compute version string for current (i.e. previous) version
|
||||||
|
compute_version
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
@ -13,6 +13,7 @@ trap collect_current_configuration EXIT
|
|||||||
collect_current_configuration () {
|
collect_current_configuration () {
|
||||||
local func="${FUNCNAME[0]}"
|
local func="${FUNCNAME[0]}"
|
||||||
|
|
||||||
|
# TODO: eventuell muss die version neu berechnet werden
|
||||||
current_settings_to_ismas
|
current_settings_to_ismas
|
||||||
|
|
||||||
#for line in $(cat $UPDATE_CONF |\
|
#for line in $(cat $UPDATE_CONF |\
|
||||||
@ -167,6 +168,9 @@ update_psa() {
|
|||||||
log_error "$func:${LINENO}: cleanup_previous_version failed"
|
log_error "$func:${LINENO}: cleanup_previous_version failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# compute version string for current (i.e. new) version
|
||||||
|
compute_version
|
||||||
|
|
||||||
update_psa_cleanup $UPDATE_ISMAS_PROGRESS \
|
update_psa_cleanup $UPDATE_ISMAS_PROGRESS \
|
||||||
$RC_SUCCESS "cleanup after psa update"
|
$RC_SUCCESS "cleanup after psa update"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user