java/target/refreshInstance.sh
... ...
@@ -141,7 +141,7 @@ load_from_release_file ()
141 141
echo "You didn't provide a release. Defaulting to latest master build http://releases.sapsailing.com/$INSTALL_FROM_RELEASE"
142 142
fi
143 143
if [[ ${INSTALL_FROM_RELEASE} != "" ]]; then
144
- echo "Build/Deployment process has been started - it can take 5 to 20 minutes until your instance is ready. " | mail -r simon.marcel.pamies@sap.com -s "Build or Deployment of $INSTANCE_ID to $SERVER_HOME for server $SERVER_NAME starting" $BUILD_COMPLETE_NOTIFY
144
+ echo "Build/Deployment process has been started - it can take 5 to 20 minutes until your instance is ready. " | mail -r simon.marcel.pamies@sap.com -s "Build or Deployment of $INSTANCE_ID to $SERVER_HOME for server $SERVER_NAME starting" ${BUILD_COMPLETE_NOTIFY}
145 145
cd ${SERVER_HOME}
146 146
rm -f ${SERVER_HOME}/${INSTALL_FROM_RELEASE}.tar.gz*
147 147
rm -rf *.tar.gz
... ...
@@ -193,7 +193,7 @@ build ()
193 193
MEM_TOTAL=`free -mt | grep Total | awk '{print $2}'`
194 194
if [ $MEM_TOTAL -lt 924 ]; then
195 195
echo "Could not start build process with less than 1GB of RAM!"
196
- echo "Not enough RAM for completing the build process! You need at least 1GB. Instance NOT started!" | mail -r simon.marcel.pamies@sap.com -s "Build of $INSTANCE_ID failed" $BUILD_COMPLETE_NOTIFY
196
+ echo "Not enough RAM for completing the build process! You need at least 1GB. Instance NOT started!" | mail -r simon.marcel.pamies@sap.com -s "Build of $INSTANCE_ID failed" ${BUILD_COMPLETE_NOTIFY}
197 197
else
198 198
if [[ $BUILD_BEFORE_START == "True" ]]; then
199 199
cd $PROJECT_HOME
... ...
@@ -230,10 +230,10 @@ deploy ()
230 230
STATUS=$?
231 231
if [ $STATUS -eq 0 ]; then
232 232
echo "Deployment Successful"
233
- echo "OK - check the attachment for more information." | mail -a $SERVER_HOME/last_automatic_build.txt -r simon.marcel.pamies@sap.com -s "Build or Deployment of $INSTANCE_ID complete" $BUILD_COMPLETE_NOTIFY
233
+ echo "OK - check the attachment for more information." | mail -a $SERVER_HOME/last_automatic_build.txt -r simon.marcel.pamies@sap.com -s "Build or Deployment of $INSTANCE_ID complete" ${BUILD_COMPLETE_NOTIFY}
234 234
else
235 235
echo "Deployment Failed"
236
- echo "ERROR - check the attachment for more information." | mail -a $SERVER_HOME/last_automatic_build.txt -r simon.marcel.pamies@sap.com -s "Build of $INSTANCE_ID failed" $BUILD_COMPLETE_NOTIFY
236
+ echo "ERROR - check the attachment for more information." | mail -a $SERVER_HOME/last_automatic_build.txt -r simon.marcel.pamies@sap.com -s "Build of $INSTANCE_ID failed" ${BUILD_COMPLETE_NOTIFY}
237 237
fi
238 238
}
239 239
java/target/start
... ...
@@ -146,20 +146,18 @@ if [[ $PARAM == "" ]] || [[ $PARAM == "no-update" ]]; then
146 146
if [[ $PLATFORM != "Darwin" ]]; then
147 147
if [[ $SERVER_PORT == "" ]] || [[ $SERVER_ACTIVE == "" ]]; then
148 148
echo "Something went wrong with startup. Please check the logs..."
149
- if [[ $SERVER_STARTUP_NOTIFY != "" ]]; then
150
- echo "Startup of java server $SERVER_NAME on $INSTANCE_ID failed - check the logs ($SERVER_ACTIVE)\n\n$NETSTAT\n$PROCESS_INFO" | mail -s "Server $INSTANCE_ID startup failed!" $SERVER_STARTUP_NOTIFY
149
+ if [[ ${SERVER_STARTUP_NOTIFY} != "" ]]; then
150
+ echo "Startup of java server ${SERVER_NAME} on ${INSTANCE_ID} failed - check the logs ($SERVER_ACTIVE)\n\n$NETSTAT\n$PROCESS_INFO" | mail -s "Server $INSTANCE_ID startup failed!" ${SERVER_STARTUP_NOTIFY}
151 151
fi
152 152
exit
153 153
fi
154 154
fi
155
-
156 155
echo "Started $SERVER_NAME - use telnet localhost $TELNET_PORT to connect to the OSGi console. Logs should be found in logs/sailing0.log.0"
157
-
158
- if [[ $SERVER_STARTUP_NOTIFY != "" ]]; then
156
+ if [[ ${SERVER_STARTUP_NOTIFY} != "" ]]; then
159 157
if [[ ! -z "$ON_AMAZON" ]]; then
160 158
echo "Go to http://$INSTANCE_DNS:$SERVER_PORT to reach your instance!" | mail -s "Server $SERVER_NAME on $INSTANCE_ID started up!" -a env.sh $SERVER_STARTUP_NOTIFY
161 159
else
162
- echo "OK" | mail -s "Server $SERVER_NAME on $INSTANCE_ID started up!" -a env.sh $SERVER_STARTUP_NOTIFY
160
+ echo "OK" | mail -s "Server $SERVER_NAME on $INSTANCE_ID started up!" -a env.sh ${SERVER_STARTUP_NOTIFY}
163 161
fi
164 162
fi
165 163
elif [[ $PARAM == "debug" ]]; then
wiki/info/landscape/amazon-ec2.md
... ...
@@ -178,6 +178,12 @@ More variables are available, and some variables---if not set in the environment
178 178
* `SERIES_HOSTNAME`
179 179
If specified, overrides the `${SERVER_NAME}.sapsailing.com` default for reverse proxy mappings requested by providing event IDs in the `SERIES_ID` variable. If array notation is used for `SERIES_ID` then so should it for `SERIES_HOSTNAME`.
180 180
181
+* `BUILD_COMPLETE_NOTIFY`
182
+ The comma-separated list of e-mail addresses to send a notification message to after a release has been installed or built from sources.
183
+
184
+* `SERVER_STARTUP_NOTIFY`
185
+ The comma-separated list of e-mail addresses to send a notification message to after a server process has been launched.
186
+
181 187
* `image-upgrade`
182 188
If provided in a line of its own, the `httpd` server on the instance will be stopped, no application server release will be installed, the operating system packages will be updated, the git repository under `/home/sailing/code` will be pulled for the branch that the workspace is checked out on for the image launched (usually `master`) which will update various scripts relevant for the bootstrapping process, all log directories for `httpd` and the application server will be cleared, and by default the instance will then be shut down for a new AMI to be created for it. See also the `no-shutdown` user data option.
183 189