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
26f26282
Commit
26f26282
authored
7 years ago
by
juanf
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-5582 : New v3 upgrade script
SVN: 38718
parent
285803b4
No related branches found
No related tags found
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
+83
-0
83 additions, 0 deletions
installation/resource/installer/bin/upgrade-eln-v3.sh
with
83 additions
and
0 deletions
installation/resource/installer/bin/upgrade-eln-v3.sh
0 → 100644
+
83
−
0
View file @
26f26282
#!/bin/bash
# Upgrades openbis ELN-LIMS.
# Asumes that the eln-lims tarball is on the 'servers' directory
# Assumes that core-plugins are installed in the 'servers' directory on the same level as this script parent directory
##
## Upgrade script algorithm explained
##
#-- If current installation don't exists return with message, no eln-lims installation found, do a normal first installation
#-- If installation exists
#-- Check if current installation is a minimum master data installation
#-- Backup etc folder (skip if etc folder don't exist)
#-- Remove eln-lims folder
#-- Uncompress eln-lims tarball into the core-plugins folder
#-- If last installation was minimum master data installation, remove extra eln-lims master data script (skip if wasn't)
#-- Restore etc folder from backup (skip if backup don't exist)
echo
"1 - Starting ELN-LIMS Upgrade"
# Define a timestamp function
timestamp
()
{
date
+
"%y%m%d-%H%M"
}
# 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_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_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
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
#Remove ELN-LIMS folder
echo
"5 - Remove current ELN-LIMS installation"
rm
-rf
$ELN_INSTALLATION
#Uncompress eln-lims tarball into the eln-lims folder
echo
"6 - Uncompressing tarball"
tar
xfz
$ELN_TARBALL
-C
$CORE_PLUGINS
#if is minimum master data, remove the extra types script
if
[
IS_MINIMUM_MASTER_DATA
]
;
then
echo
"7 - Replacing master data script since minimum master data installation was found"
mv
$ELN_INSTALLATION_MINIMUM_MD_SCRIPT
$ELN_INSTALLATION_STANDARD_MD_SCRIPT
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
echo
"8 - Restoring ELN-LIMS etc folder"
cp
$BACKUP
"/eln-lims/3/as/webapps/eln-lims/html/etc/"
*
$ELN_ETC_CONFIG_FOLDER
fi
else
echo
"3 - No ELN-LIMS installation found, at folder
\"
"
$ELN_INSTALLATION
"
\"
. Do first a normal installation, this script is only for upgrades."
fi
echo
"9 - ELN-LIMS Upgrade Finished"
\ No newline at end of file
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