# legacymup

> Production Quality Meteor Deplouments

Latest version **0.1.14** (published 2019-02-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install legacymup
pnpm add legacymup
yarn add legacymup
bun add legacymup
```

Provides the command `legacymup`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.14 |
| Published | 2019-02-07 |
| First published | 2019-02-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 20.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Stephen T. Cannon |
| Maintainers | stephentcannon |

## Links

- npm: https://www.npmjs.com/package/legacymup
- Repository: https://github.com/stephentcannon/meteor-up
- Homepage: https://github.com/stephentcannon/meteor-up#readme
- Issues: https://github.com/stephentcannon/meteor-up/issues
- npm.io page: https://npm.io/package/legacymup

## Dependencies (4)

- [uuid](https://npm.io/package/uuid.md) 1.4.x
- [cjson](https://npm.io/package/cjson.md) 0.2.1
- [colors](https://npm.io/package/colors.md) 0.6.x
- [nodemiral](https://npm.io/package/nodemiral.md) 0.3.x

## Recent versions

- 0.1.14 (latest) — 2019-02-07
- 0.1.13 — 2019-02-07
- 0.1.12 — 2019-02-07
- 0.1.11 — 2019-02-07

## README

# Legacy Meteor UP

#### Production Quality Meteor Deployments

Meteor Up (legacymup) is a command line tool that allows you to deploy any pre-1.2 version meteor app into your own server. It supports Ubuntu 12.04 or higher servers from any Cloud Infrastructure Provider.

**Table of Contents**

- [Features](#features)
- [Server Configuration](#server-configuration)
- [Installation](#installation)
- [Creating a Meteor Up Project](#creating-a-meteor-up-project)
- [Example File](#example-file)
- [Setting Up a Server](#setting-up-a-server)
    - [Server Setup Details](#server-setup-details)
- [Deploying an App](#deploying-an-app)
    - [Deploy Wait Time](#deploy-wait-time)
    - [Multiple Deployment Targets](#multiple-deployment-targets)
- [Access Logs](#access-logs)
- [Reconfiguring & Restarting](#reconfiguring--restarting)

### Features

* Single command server setup
* Single command deployment
* Environmental Variables management
* Support for [`settings.json`](http://docs.meteor.com/#meteor_settings)
* Password or Private Key(pem) based server authentication
* Access, logs from the terminal (supports log tailing)

### Server Configuration

* Auto-Restart if the app crashed (using forever)
* Auto-Start after the server reboot (using upstart)
* Stepdown User Privileges
* Revert to the previous version, if the deployment failed
* Support for **Hot Code Reload**
* Secured MongoDB Installation (Optional)
* Pre-Installed PhantomJS (Optional)

### Installation

    npm install -g legacymup

If you are looking for password based authentication, you need to [install sshpass](https://gist.github.com/arunoda/7790979) on your local development machine.

### Creating a Meteor Up Project

    mkdir ~/my-meteor-deployment
    cd ~/my-meteor-deployment
    legacyup init

This will create two files in your Meteor Up project directory, which are:

  * mup.json - Meteor Up configuration file
  * settings.json - Settings for Meteor's [settings API](http://docs.meteor.com/#meteor_settings)

`mup.json` is commented and easy to follow (it supports JavaScript comments)

### Example File

```js
{
  //server authentication info
  "servers": [
    {
      "host": "123.456.789.012",
      "username": "root",
      "password": "x7fj29dhs0"
      //or pem file (ssh based authentication)
      //"pem": "~/.ssh/id_rsa"
    }
  ],

  //install MongoDB in the server
  "setupMongo": false,
  //install Nodejs in the server
  //WARNING: Nodejs is required! Only skip if you already have nodejs installed on server.
  "setupNode": true,
  //install PhantomJS in the server
  "setupPhantom": true,

  //location of app (local directory)
  "app": "/Users/stephenetcannon/Meteor/my-app",

  //configure environmental
  "env": {
    "PORT": 80,
    "ROOT_URL": "http://myapp.com",
    "MONGO_URL": "mongodb://stc:fd8dsjsfh7@hanso.mongohq.com:10023/MyApp",
    "MAIL_URL": "smtp://postmaster%40myapp.mailgun.org:adj87sjhd7s@smtp.mailgun.org:587/"
  },

  //meteor-up checks if the app comes online just after the deployment
  //before mup checks that, it will wait for no. of seconds configured below
  "deployCheckWaitTime": 15
}
```

### Setting Up a Server

    legacymup setup

This will setup the server for the mup deployments. It will take around 2-5 minutes depending on the server's performance and network availability.

#### Server Setup Details

This is how Meteor Up will configure the server for you. This information will help you to customize server for your needs.

* your app is lives in `/opt/meteor/app`
* mup uses upstart with a config file at `/etc/init/meteor.conf`
* you can start and stop the app with upstart: `start meteor` and `stop meteor`
* logs are located at: `/var/log/upstart/app.log`
* MongoDB installed and bind to the local interface (cannot access from the outside)
* `mongo` is the name of the database

For more information see [`lib/taskLists.js`](https://github.com/stephentcannon/meteor-up//lib/taskLists.js).

### Deploying an App

   legacymup deploy

This will bundle the meteor project and deploy it to the server.

#### Deploy Wait Time

Meteor-Up checks for if the deployment is successful or not just after the deployment. By default, it will wait 10 seconds before the check. You can configure the wait time with `deployCheckWaitTime` option in the `mup.json`

#### Multiple Deployment Targets

You can use an array to deploy to multiple servers at once. 

To deploy to *different* environments (e.g. staging, production, etc.), use separate Meteor Up configurations in separate directories, with each directory containing separate `mup.json` and `settings.json` files, and the `mup.json` files' `app` field pointing back to your app's local directory. 

#### Custom Meteor Binary

Sometime, you might be using Meteor from a git checkout or using `mrt`. By default Meteor Up uses `meteor`. You can ask Meteor Up to use the correct binary with `meteorBinary` option.

~~~js
{
  ...
  "meteorBinary": "~/bin/meteor/meteor"
  ...
}
~~~

### Access Logs

    legacymup logs -f

Mup can tail logs from the server and it supports all the options of `tail`

### Reconfiguring & Restarting

After you've edit environmental variables or settings.json, you can reconfigure the app without deploying again. Use following command for that.

    legacymup reconfig

This will also restart the app, so you can use it for that purpose even if you didn't change the configuration file.

---
_Source: https://npm.io/package/legacymup · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
