Skip to content
Snippets Groups Projects
Commit 40f47020 authored by Yuci Gou's avatar Yuci Gou
Browse files

Reinstate initialization sequence of the ftp monitors

parent b84eac59
No related branches found
No related tags found
2 merge requests!116Shared data model,!117Dev
const pm2Config = {
apps: [
{
name: 'pubsweet',
script: './node_modules/pubsweet/src/startup/start.js',
exec_mode: 'cluster_mode',
instances: 1,
},
{
name: 'ftpBulkMonitor',
script: './server/ftp-integration/api.js',
exec_mode: 'cluster_mode',
instances: 1,
},
{
name: 'ftpTaggerMonitor',
script: './server/ftp-integration/taggedXML.js',
exec_mode: 'cluster_mode',
instances: 1,
},
],
......
const pm2Config = {
apps: [
{
name: 'pubsweet',
script: './node_modules/pubsweet/src/startup/start.js',
exec_mode: 'cluster_mode',
instances: 1,
},
],
}
module.exports = pm2Config
......@@ -5,11 +5,8 @@ echo "Running cron service"
env | cat - /etc/cron.d/crontab > temp && crontab temp
service cron start
echo "Running ftp upload monitors"
pm2 start pm2.ftp.config.js
echo "Running Seed"
yarn seed
#!/bin/bash
echo "Running server in the background"
cmd="pm2 start pm2.config.js"
cmd="pm2 start pm2.pubsweet.config.js"
$cmd &
sleep 30
echo "Wait up to 3 minutes for server to respond, check every 20 seconds"
COUNTER=0
while [ $COUNTER -lt 15 ]; do
echo "Running post_init.sh script"
./post_init.sh
RUNNING=$(curl --silent --connect-timeout 20 "$PUBSWEET_URL" | grep "/assets/")
if [ -n "$RUNNING" ] ; then
echo "xPub is running"
#echo "Creating the Users"
#node scripts/adduser.js rakeshnambiar rakeshnbr@ebi.ac.uk Password_01 false
echo "Running post_init.sh script"
./post_init.sh
tail -f /dev/null
fi
echo "Waiting for xPub..."
sleep 20
let COUNTER=COUNTER+1
done
echo "ERROR: xPub is not running"
echo "Initialization completed. PubSweet up running..."
tail -f /dev/null
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment