0

I have a a simple meteor 1.0 app that I want to deploy on my Digital Ocean Droplet. I can access this Droplet using ssh.

How can I deploy this app? Is there anything I should install and what are the settings I should use on my Droplet?

JLavoie
  • 16,678
  • 8
  • 33
  • 39

2 Answers2

4

I've used arunoda's solution to deploy to my DO Droplet

https://github.com/arunoda/meteor-up

As in the docs after installing the module you'll get the mup command

You can find the detail documentation on how to deploy here

https://meteorhacks.com/deploy-a-meteor-app-into-a-server-or-a-vm.html

Sasikanth
  • 3,045
  • 1
  • 22
  • 45
  • Great! This is the kind of tool I was looking for. It just does all the clerical tasks for me like connecting to ssh, copy the files, etc... Thanks! :) – JLavoie Nov 11 '14 at 23:17
  • @JoeTek, If that answers your question accept this as answer by clicking the right icon under the upvote/downvote buttons, I saw your other questions also not marked as accepted. Please do that. – Sasikanth Nov 12 '14 at 04:36
  • Oh! I tought I only need to upvote! Thanks for everything. :) – JLavoie Nov 12 '14 at 15:13
  • Be aware that for the destination server, on Ubuntu 10.04, it is not straightforward. I got many problems. But for Ubuntu 14.04 everything was smooth. Not tested on Ubuntu 12.02. – JLavoie Nov 12 '14 at 18:08
0

All the solution I found were not working well with Ubuntu 10.04. An easy solution is to simply write a bash script to send the code on the remote server and reload the meteor application:

  1. Share a public key between your development environment and the remote server (How tohere)
  2. Create the following script file (myscript.sh) with the following instructions in it (make sure you edit the variables in the header!):

myscript.sh:

#!/bin/bash

#*************** ONLY EDIT THIS PART    
SERVER='<SERVER_IP>'
PORT='22'
USERNAME="root"
PROJECT_NAME="<PROJECT_FOLDER_NAME>"
DESTINATION_PATH="</home/any_user/projects>"
ORIGIN_PATH="</home/any_user/projects/project_folder_name>"
COPY_METEOR_PACKAGES=FALSE
#******************

echo ""
echo "Deployment on $USERNAME@$SERVER:$PORT:$DESTINATION_PATH"
echo "Make sure to have a public key on the server! http://www.linuxproblem.org/art_9.html"
echo ""

#copy the files
if $COPY_METEOR_PACKAGES==true; then
   echo "Copy packages"
   scp -P $PORT -r $ORIGIN_PATH $USERNAME@$SERVER:$DESTINATION_PATH
else
   echo "Do not copy packages"
   scp -P $PORT -r $ORIGIN_PATH/client $USERNAME@$SERVER:$DESTINATION_PATH
   scp -P $PORT -r $ORIGIN_PATH/common $USERNAME@$SERVER:$DESTINATION_PATH
   scp -P $PORT -r $ORIGIN_PATH/lib $USERNAME@$SERVER:$DESTINATION_PATH
   scp -P $PORT -r $ORIGIN_PATH/public $USERNAME@$SERVER:$DESTINATION_PATH
   scp -P $PORT -r $ORIGIN_PATH/server $USERNAME@$SERVER:$DESTINATION_PATH
fi


# reload meteor
ssh $USERNAME@$SERVER bash -c "'
cd $DESTINATION_PATH/$PROJECT_NAME
meteor
exit
'"

Useful info here:

  1. Just run the script using the following command in your development console:

    sh myscript.sh

  2. Et voila! When you run this script, it will copy the files and the packages (no need to transfer all the time) to the remote server of your choice using the SSH protocol and it restart the server in case it has crashed (it shouldn't but it was the case for me).

JLavoie
  • 16,678
  • 8
  • 33
  • 39