Skip to content

Online deployment routine with meteor up

Dominique Merle edited this page Sep 16, 2017 · 1 revision

Might be useful for people trying to deploy online.

Setup

  • Create a directory deploy.
  • Create the following files:
    • deploy/mup.js (attached below)
    • deploy/private/id_rsa.pub
    • deploy/private/id_rsa (ask @virgile-dev)
  • install mup: https://github.com/kadirahq/meteor-up

Commands

  • npm install -g mup
  • cd deploy
  • mup deploy --settings=../config/development/settings.json

Other commands:

  • mup logs
  • mup start
  • mup stop

Notes

Mup does not like the output of the server start for some reason:

(...)
[your-host.com] - Start Meteor
[your-host.com] - Start Meteor: SUCCESS
[your-host.com] - Verifying Deployment
[your-host.com] x Verifying Deployment: FAILED


-----------------------------------STDERR-----------------------------------
key configuration for this instance...
-- MISSING SETTING: Amazon Web Services for resource storage
keys not configured.
-- FIX: Configure `AWSAccessKeyId`, `AWSSecretAccessKey` and
`public.AWSHostingURL` on settings.json.
-- MISSING SETTING: Mailgun SMTP server keys not configured.
-- FIX: Configure `smtpServer` on settings.json.
-- MISSING SETTING: Facebook API keys not configured.
-- FIX: Configure `private.API.facebook.appId` and
`private.API.facebook.appSecret` on settings.json.
-- MISSING SETTING: Twitter API keys not configured.
-- FIX: Configure `private.API.twitter.APIKey` and
`private.API.twitter.APISecret` on settings.json.
-- MISSING SETTING: Google Analytics tracking ID not configured.
-- FIX: Configure `public.analyticsSettings["Google
Analytics"].trackingId` on settings.json.
-- MISSING SETTING: Kadira keys for performance app testing not
configured.
-- FIX: Configure `kadira.appId` and `kadira.appSecret` on
settings.json.

=> Redeploying previous version of the app

-----------------------------------STDOUT----------------------------------

To see more logs type 'mup logs --tail=50'

---------------------------------------------------------------------------

mup.js

module.exports = {
  servers: {
    one: {
      host: 'your-host.com',
      username: 'root',
      pem: '../private/id_rsa', // mup doesn't support '~' alias for home directory
      opts: {
          port: 2221
      }
    }
  },

  meteor: {
    name: 'test-demoearth',
    path: '../', // mup doesn't support '~' alias for home directory
    port: 80, // useful when deploying multiple instances (optional)
    volumes: { // lets you add docker volumes (optional)
      // "/host/path": "/container/path", // passed as '-v /host/path:/container/path' to the docker run command
      // "/second/host/path": "/second/container/path"
    },
    docker: {
      // image: 'kadirahq/meteord', // (optional)
      image: 'abernix/meteord:base',
      // image: 'abernix/meteord:base', // use this image if using Meteor 1.4+
      args:[ // lets you add/overwrite any parameter on the docker run command (optional)
        // "--link=myCustomMongoDB:myCustomMongoDB", // linking example
        // "--memory-reservation 200M" // memory reservation example
      ]
    },
    servers: {
      one: {} // list of servers to deploy, from the 'servers' list
    },
    buildOptions: {
      // serverOnly: true,
      // debug: true,
      // cleanAfterBuild: true, // default
      // buildLocation: '/my/build/folder', // defaults to /tmp/<uuid>
      // mobileSettings: {
        // yourMobileSetting: "setting value"
      // }
    },
    env: {
      ROOT_URL: 'http://your-host.com',
      MONGO_URL: 'mongodb://localhost/meteor'
      // KADIRA_APP_ID: '',
      // KADIRA_APP_SECRET: ''
    },
    // log: { // (optional)
    //   driver: 'syslog',
    //   opts: {
    //     "syslog-address":'udp://syslogserverurl.com:1234'
    //   }
    // },
    // ssl: {
    //   port: 443,
    //   crt: 'bundle.crt',
    //   key: 'private.key',
    // },
    deployCheckWaitTime: 120 // default 10
  },

  mongo: { // (optional)
    oplog: true,
    port: 27017,
    servers: {
      one: {}
    }
  }
};
Clone this wiki locally