meteor-deploy

Deploy meteor apps to your custom server using SSH!

npm install meteor-deploy
1 downloads in the last week
33 downloads in the last month

meteor-deploy

Deploy meteor applications to your own servers using SSH and SFTP. Pull and feature requests are encouraged.

This package will deploy your meteor application in a way to be able to rollback to a previous deployment. Basic filestructure is:

/<configured remote path>/<environment>/
  .payloads
    <projectName>-<deployment timestamp>
    ...
  <ProjectName> -> symlink to current deployment
  <ProjectName-previous> -> symlink to previous deployment

Installation

npm install -g meteor-deploy

Configuration

Imagine the following package.json:

{
  "name": "MyCoolApp",
  "version": "0.1.0",
  "repository": {
    "type": "git",
    "url": "https://github.com/xenolf/meteor-deploy.git"
  },
  "author": "azhwkd",
  "deployConfig": {
    "alpha": {
      "remote" : "192.0.0.100",
      "port": "22",
      "user": "myCoolSSHUser",
      "cert": "/path/to/my/private/key",
      "passphrase": "coolPass101",
      "remotePath": "/path/where/my/apps/should/run",
      "ref": "origin/alpha",
      "runPort": "3000",
      "rootUrl": "http://coolurl.com",
      "mongoUrl": "mongodb://localhost:27017/meteor",
      "mailUrl": "smtp://..."
    }
  }
}

The deployConfig node is the root of all evil. Under it there are so called environment nodes. For every environment you want to deploy to you can add a new object and so every environment can have its own server and credentials.

Standard options

  • remote The server you want to deploy to. Has to have an SSH server with SFTP subsystem.
  • port (Optional) The port of your SSH server. Defaults to 22 if not declared otherwise.
  • user The username to use for the SSH connection.
  • cert The private key file for your SSH user.
  • passphrase (Optional) Passphrase for your SSH cert. Only needed if your cert has one set.
  • remotePath The absolute path on the server where you want to run the app.
  • ref (Optional) a git reference in the form of [remote]/[branch]. The git HEAD will get reset to this reference. Defaults to the latest ref.

Forever options

  • runPort (Optional) If specified then this value will get passed to meteor in the PORT env var. Defaults to 3000
  • rootUrl The url root of your application.
  • mongoUrl (Optional) The connection string to your mongoDB. Defaults to mongodb://localhost:27017/meteor
  • mailUrl (Optional) If your app uses mail you have to set this to a valid smtp uri.

Usage

Usage: meteor-deploy [options] [command]

  Commands:

    rollback               Rolls back to the last deployed version.
    deploy                 Deploys the git repository to a remote server.

  Options:

    -h, --help           output usage information
    -V, --version        output the version number
    --env <environment>  Deploy to the provided environment.
    --mrt                Deploy using meteorite. Default false.
    -f, --forever        Attempt to start/restart the program on the server using forever.
npm loves you