Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
d9da3cd3
"README.md" did not exist on "4ed95426966e042e415540a3a5b890e14acedbf0"
Commit
d9da3cd3
authored
7 years ago
by
juanf
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-5688 : Smarter script
SVN: 38785
parent
02dc9dd2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
installation/resource/installer/bin/upgrade-eln-v3.sh
+28
-16
28 additions, 16 deletions
installation/resource/installer/bin/upgrade-eln-v3.sh
with
28 additions
and
16 deletions
installation/resource/installer/bin/upgrade-eln-v3.sh
+
28
−
16
View file @
d9da3cd3
...
...
@@ -24,38 +24,40 @@ timestamp() {
date
+
"%y%m%d-%H%M"
}
VERSION
=
3
# Directories used
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
BASE
=
$DIR
"/.."
BACKUP_BASE
=
$BASE
"/backup"
BACKUP
=
$BACKUP_BASE
"/
$(
timestamp
)
"
CORE_PLUGINS
=
$BASE
"/servers/core-plugins/"
ELN_BACKUP
=
$BACKUP
"/eln-lims"
ELN_INSTALLATION
=
$BASE
"/servers/core-plugins/eln-lims"
ELN_INSTALLATION_MINIMUM_MD_SCRIPT
=
$ELN_INSTALLATION
"/3/as/initializemasterdataminimum.py"
ELN_INSTALLATION_STANDARD_MD_SCRIPT
=
$ELN_INSTALLATION
"/3/as/initialize-master-data.py"
ELN_ETC_CONFIG_FOLDER
=
$ELN_INSTALLATION
"/3/as/webapps/eln-lims/html/etc/"
ELN_INSTALLATION_MINIMUM_MD_SCRIPT
=
$ELN_INSTALLATION
"/"
$VERSION
"/as/initializemasterdataminimum.py"
ELN_INSTALLATION_STANDARD_MD_SCRIPT
=
$ELN_INSTALLATION
"/"
$VERSION
"/as/initialize-master-data.py"
ELN_TARBALL_LOCATION
=
$BASE
"/servers/eln-lims-*.tar.gz"
;
ELN_TARBALL
=
"
$(
ls
$ELN_TARBALL_LOCATION
)
"
#The script fails and exits automatically if the tarball is not found
echo
"2 - The ELN-LIMS tarball found to be used is: "
$ELN_TARBALL
if
[
-d
$ELN_INSTALLATION
]
;
then
#Check if is a minimum master data installation
if
[
-f
$ELN_INSTALLATION_MINIMUM_MD_SCRIPT
]
;
then
IS_MINIMUM_MASTER_DATA
=
false
IS_MINIMUM_MASTER_DATA
=
false
else
IS_MINIMUM_MASTER_DATA
=
true
fi
echo
"3 - Is minimum master data installation: "
$IS_MINIMUM_MASTER_DATA
#Backup ELN-LIMS etc folder
if
[
-d
$ELN_ETC_CONFIG_FOLDER
]
;
then
echo
"4 - Backing up ELN-LIMS etc folder at: "
$BACKUP
#Creating backup folder and its parents if doesn't exist
mkdir
-p
$BACKUP
"/eln-lims/3/as/webapps/eln-lims/html/etc/"
cp
$ELN_ETC_CONFIG_FOLDER
*
$BACKUP
"/eln-lims/3/as/webapps/eln-lims/html/etc/"
else
echo
"4 - ELN-LIMS etc folder was not found, is this installation quite old?"
fi
#Backup ELN-LIMS folder
echo
"4 - Backing up ELN-LIMS folder at: "
$BACKUP
mkdir
-p
$ELN_BACKUP
cp
-rf
$ELN_INSTALLATION
*
$BACKUP
rm
-rf
$ELN_BACKUP
"/bin/"
#Delete blast if found
#Remove ELN-LIMS folder
echo
"5 - Remove current ELN-LIMS installation"
...
...
@@ -72,11 +74,21 @@ if [ -d $ELN_INSTALLATION ]; then
else
echo
"7 - Not modifying master data scripts since a standard master data installation was found"
fi
#Restore etc folder contents if they where backup
if
[
-d
$BACKUP
"/eln-lims/3/as/webapps/eln-lims/html/etc/"
]
;
then
#Restore config folder contents if they where backup
if
[
-d
$ELN_BACKUP
"/"
$VERSION
"/as/webapps/eln-lims/html/etc/"
]
;
then
echo
"8 - Restoring ELN-LIMS etc folder"
cp
$BACKUP
"/
eln-lims/3
/as/webapps/eln-lims/html/etc/"
*
$ELN_
ETC_CONFIG_FOLDER
cp
$
ELN_
BACKUP
"/
"
$VERSION
"
/as/webapps/eln-lims/html/etc/"
*
$ELN_
INSTALLATION
"/"
$VERSION
"/as/webapps/eln-lims/html/etc/"
fi
#Restore config files if they where backup
declare
-a
CONFIG_FILES
=(
"/"
$VERSION
"/as/miscellaneous/file-service/plugin.properties"
"/"
$VERSION
"/dss/drop-boxes/eln-lims-dropbox/plugin.properties"
"/"
$VERSION
"/dss/maintenance-tasks/blastdb/plugin.properties"
"/"
$VERSION
"/dss/reporting-plugins/exports-api/plugin.properties"
)
for
CONFIG_FILE
in
"
${
CONFIG_FILES
[@]
}
"
;
do
echo
"8b - Checking backup config file: "
$ELN_BACKUP$CONFIG_FILE
if
[
-f
$ELN_BACKUP$CONFIG_FILE
]
;
then
echo
"8b - Restoring found config file: "
$ELN_BACKUP$CONFIG_FILE
cp
$ELN_BACKUP$CONFIG_FILE
$ELN_INSTALLATION$CONFIG_FILE
fi
done
else
echo
"3 - No ELN-LIMS installation found, at folder
\"
"
$ELN_INSTALLATION
"
\"
. Do first a normal installation, this script is only for upgrades."
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment