_version=1.8.3

karafRoot = ((($.context bundle) loadClass java.lang.System) getProperty 'karaf.home')
cd $karafRoot

source scripts/update/utils
source scripts/update/operations
source scripts/update/executor

karafEtc = ((($.context bundle) loadClass java.lang.System) getProperty 'karaf.etc')
mvnCfg = "org.ops4j.pax.url.mvn.cfg"


# BEGIN PLAN

${platform.1.8.2.plan}

#END PLAN

initManagerPid = "ru.entaxy.esb.initializer"
skipAllProp = "skip.all"

echo "*****"
echo "** Installing updates with version ${_version}"
echo "*****"

echo
# disable all initializations during updates
config:edit $initManagerPid
config:property-set "${skipAllProp}" "true"
config:update
echo "\>\> Initializers set to be skipped during update"

__EXEC_PLAN $installPlan

# enable all initializations during updates
config:edit $initManagerPid
config:property-set "${skipAllProp}" "false"
config:update

echo
echo "\>\> Initializers restored"

