3
votes

I have some Meteor apps running on AWS EC2 instances.

Everything is working fine except when I bundle and then tar -zxvf bundle.tgz into the /bundle directory.

The application does not hot deploy like it does on meteor.com. I have to reboot the servers.

Here is my service script

start on runlevel [2345]

stop on runlevel [-2345]

respawn

respawn limit 10 5

script
APP_DIR=/home/ubuntu/bundle
LOG_FILE=/var/log/app.log

export PORT=80 export

MONGO_URL=mongodb://somelogin:fakepasssword@somedomain:1231231/app_db

export ROOT_URL=http://somedomain.com

/usr/bin/node "$APP_DIR/main.js" 2>&1 >> $LOG_FILE

end script

Any ideas?

2

2 Answers

2
votes

The deployed apps (made via meteor bundle) don't do hot code changes. You have to update the files then stop and restart the node process.

You could use something like forever to keep them running then do a forever restart to get them running the new code

To use forever you could have a script with something like:

APP_DIR=/home/ubuntu/bundle
export PORT=80
export MONGO_URL=mongodb://somelogin:fakepasssword@somedomain:1231231/app_db
export ROOT_URL=http://somedomain.com
forever start "$APP_DIR/main.js"

Then when you update your files in /home/ubuntu/bundle just do the same thing above but with forever restart instead of forever start.

0
votes

Have a look inside https://github.com/matb33/meteor-ec2-install for some insight.

Whenever I deploy and node restarts, all connected clients get a hot code push. I'm doing a proper deploy too... Perhaps parts of the hot code push functionality don't carry over such as Sessions, I'm not sure.