-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install
executable file
·140 lines (116 loc) · 3.07 KB
/
Install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/sh
#
# Installation script
#
Usage=Install
cd `dirname $0`
COMMON_CONFIG=common.config
PROVIDER_CONFIGS="emapslimload.config goslimload.config mpslimload.config"
#
# Function called when the install fails.
#
installFailed ()
{
echo "Installation Failed: `date`"
exit 1
}
#
# Verify the arguments to the script, there shouldn't be any
#
if [ $# -ne 0 ]
then
echo "Usage: ${Usage}"
installFailed
fi
#
# Make sure all the configuration files exist.
#
for i in ${COMMON_CONFIG} ${PROVIDER_CONFIGS}
do
if [ ! -r ${i} ]
then
echo "Missing configuration file: ${i}"
installFailed
fi
done
#
# Source the common configuration file.
#
. ${COMMON_CONFIG}
# Check to see if this is a development installation
#
DEV=""
if [ "${INSTALL_TYPE}" = "dev" ]
then
DEV="-d"
fi
#
# run DLAInstall for each configuration file
#
for i in ${PROVIDER_CONFIGS}
do
#
# Source the provider configuration file.
#
. ${i}
echo 'running DLAINSTALL'
${DLAINSTALL} ${DEV}
#
# Create the input directory.
#
if [ ! -d ${INPUTDIR} ]
then
mkdir -p ${INPUTDIR}
fi
#
# If the input file does not exist already, create one that is writable.
# This is just a place holder until an input file is published.
# The input directory should be opened up to allow the curation staff
# to publish new input files.
#
if [ ! -f ${INPUT_FILE_DEFAULT} ]
then
touch ${INPUT_FILE_DEFAULT}
chmod 664 ${INPUT_FILE_DEFAULT}
chgrp mgi ${INPUT_FILE_DEFAULT}
fi
chmod -f 775 ${INPUTDIR}
chgrp mgi ${INPUTDIR}
chmod -f 775 ${OUTPUTDIR}
chgrp mgi ${OUTPUTDIR}
chmod -f 775 ${LOGDIR}
chgrp mgi ${LOGDIR}
chmod -f 755 ${LOAD_QC_SH}
done
# copy the scripts for curator use into a standard location which exists in
# their path statements
# trim any trailing slash from MGIBIN variable
DEPLOY_PATH=`echo "${MGIBIN}" | sed 's./$..'`
if [ "${DEPLOY_PATH}" = "" ]; then
echo "Warning: MGIBIN variable missing from mgiconfig; cannot deploy curator files"
exit 0
fi
if [ ! -d ${DEPLOY_PATH} ]; then
# failure to deploy is not a fatal error; could happen during
# development under a home directory
echo "Warning: ${DEPLOY_PATH} does not exist; curator scripts were not copied."
exit 0
fi
if [ -d ${DEPLOY_PATH} ]; then
# copy files, change permissions, and check for errors
# deployment errors are non-fatal, as they can occur regularly in an
# SE's development area
for file in runEmapSlimQC publishEmapSlim runGoSlimQC publishGoSlim runMpSlimQC publishMpSlim
do
cp bin/${file} ${DEPLOY_PATH}
if [ $? -ne 0 ]; then
echo "Warning: Failed to copy ${file} to ${DEPLOY_PATH}"
fi
chmod 755 ${DEPLOY_PATH}/${file}
if [ $? -ne 0 ]; then
echo "Warning: Failed to change permissions on ${DEPLOY_PATH}/${file}"
fi
done
echo "Deployed curator files to ${DEPLOY_PATH}"
fi
exit 0