refs #1268: smartgears-distribution 1.2.5: distribution field on monitor is missing when a smartgears node is upgraded
https://support.d4science.org/issues/1268 Updated install script to support this upgrade git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/distributions/smartgears-distribution@122131 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
e48b1d9404
commit
a2f04b4927
|
@ -197,11 +197,55 @@ for f in $distroscripts/*;
|
|||
sleep .01
|
||||
done
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#install config
|
||||
function escape_slashes {
|
||||
sed 's/\//\\\//g'
|
||||
}
|
||||
|
||||
function change_line {
|
||||
local OLD_LINE_PATTERN=$1; shift
|
||||
local NEW_LINE=$1; shift
|
||||
local FILE=$1
|
||||
|
||||
local NEW=$(echo "${NEW_LINE}" | escape_slashes)
|
||||
sed -i '/'"${OLD_LINE_PATTERN}"'/s/.*/'"${NEW}"'/' "${FILE}"
|
||||
}
|
||||
|
||||
function replace_property {
|
||||
local PROPERTY=$1
|
||||
local NEW_LINE=$(sed -n "/${PROPERTY}/p" $distro/container.xml)
|
||||
#echo "Replacing property ${PROPERTY}:"
|
||||
#local OLD_LINE=$(sed -n "/${PROPERTY}/p" $ghnhome/container.xml)
|
||||
#echo $OLD_LINE
|
||||
#echo $NEW_LINE
|
||||
change_line ${PROPERTY} ${NEW_LINE} $ghnhome/container.xml
|
||||
#echo "done."
|
||||
}
|
||||
|
||||
echo -e "\ninstalling configuration \c"
|
||||
if [ ! -s "$ghnhome/container.xml" ]; then
|
||||
if [ -z "$dryrun" ]; then
|
||||
cp $distro/container.xml $ghnhome/
|
||||
cp $distro/container.xml $ghnhome/
|
||||
fi
|
||||
echo -n "."
|
||||
sleep .01
|
||||
else
|
||||
if [ -z "$dryrun" ]; then
|
||||
#echo "Creating a backup copy of $ghnhome/container.xml"
|
||||
cp $ghnhome/container.xml $ghnhome/container.xml.bck
|
||||
|
||||
## Please note the ' at the end of SmartGearsDistribution property
|
||||
## the ' is needed to exactly math the property otherwise also
|
||||
## SmartGearsDistributionBundle is matched.
|
||||
for property in "SmartGearsDistribution'" "SmartGearsDistributionBundle'"
|
||||
do
|
||||
replace_property $property
|
||||
done
|
||||
fi
|
||||
echo -n "."
|
||||
sleep .01
|
||||
|
@ -213,7 +257,6 @@ if [ -z "$dryrun" ]; then
|
|||
fi
|
||||
|
||||
#creating the symlink to shared and apps folder
|
||||
|
||||
if [ -z "$dryrun" ]; then
|
||||
ln -s $shared $ghnhome/lib
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue