Git Product home page Git Product logo

meteor-hero's Introduction

Meteor Hero

meteor-hero is a tool to instantly deploy MeteorJS applications for free with one command utilizing Heroku's service. Just run meteor-hero and instantly deploy your Meteor app like you could back in the good 'ol days of meteor deploy.

Screenshot of meteor-hero

Install

Prerequisites

Docker

You'll need Docker installed and running to use meteor-hero: https://docs.docker.com/install/

Via Homebrew:

brew install docker

Heroku

Install heroku's CLI tool: https://devcenter.heroku.com/articles/heroku-cli#download-and-install

Via Homebrew:

brew tap heroku/brew && brew install heroku

Meteor-Hero

And then install meteor-hero via NPM:

npm i -g meteor-hero

Description

meteor-hero is the easiest zero-configuration tool to deploy MeteorJS apps for free, yet can scale up to production usage.

Details

This program is designed to be run inside of a MeteorJS project and will do the following:

  1. Build the meteor application to BUILD_DIR (Default: ~/.meteor-hero/builds)
  2. Unzip the contents of the built meteor application
  3. Write a Dockerfile in the BUILD_DIR
  4. Create a new heroku instance with a MongoDB addon and set the appropriate env variables
  5. Release the heroku container and print the URL where it is accessible

Usage

    meteor-hero [options] <command>

  Description:
    This program is designed to be run inside of a MeteorJS project and will do the following:

      1) Build the meteor application to BUILD_DIR (Default: ~/.meteor-hero/builds)
      2) Unzip the contents of the built meteor application
      3) Write a Dockerfile in the BUILD_DIR
      4) Create a new heroku instance with a MongoDB addon and set the appropriate env variables
      5) Release the heroku container and print the URL where it is accessible

    Note: If run outside of a meteor application, may crash due to `meteor build` failing

  Options:
    -h                 Displays help message
    -b DIR             Overwrite BUILD_DIR
    -e VAR=value       Environment variables to set on the deployed heroku instance.
    -E `FILE`          Env file to be read for environment variables to be set.

  Commands:
    []  By default deploys a MeteorJS application to heroku.
    -u  Update instead of creating a new url, update the previous deploy. The file .heroku_app_name must exist and contain the previous app name.

  Examples:

  – Deploy with environment variables

    $ meteor-hero -e MONGO_URL="mongodb://user:[email protected]" -e ROOT_URL="example.net"`

  – Deploy using env file

    $ meteor-hero -E prod.env

meteor-hero's People

Contributors

jkrup avatar moberegger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

meteor-hero's Issues

Something happened that probably shouldn't have.

Details:
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
at Object.writeFileSync (fs.js:1380:5)
at writeAppName (/usr/local/lib/node_modules/meteor-hero/commands/newDeploy.js:95:6)
at newDeploy (/usr/local/lib/node_modules/meteor-hero/commands/newDeploy.js:172:5)
at Object. (/usr/local/lib/node_modules/meteor-hero/index.js:13:5)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47

Error: Command failed: heroku container:login

@jkrup I've been experiencing this issue for about a week now. Thought I'd be able to figure it out but haven't. Same issue whether or not I include a prod.env file. Any ideas?

username@Macbook appRoot % meteor-hero -E prod.env
clearing build folder
Building meteor app...
Building meteor app (this can take several minutes)
Node#moveTo was deprecated. Use Container#append.
Built
Unzipping meteor bundle...
Writing Dockerfile...
Creating heroku container...
Creating app... done, heroku-appname-12345
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
 ▸    Login failed with: 1

  🚨 Something happened that probably shouldn't have.

  Details:
    Error: Command failed: heroku container:login
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
 ▸    Login failed with: 1

    at checkExecSyncError (child_process.js:621:11)
    at execSync (child_process.js:657:15)
    at herokuLogin (/Users/username/.nvm/versions/node/v12.10.0/lib/node_modules/meteor-hero/commands/newDeploy.js:99:3)
    at newDeploy (/Users/username/.nvm/versions/node/v12.10.0/lib/node_modules/meteor-hero/commands/newDeploy.js:173:5)
    at Object.<anonymous> (/Users/username/.nvm/versions/node/v12.10.0/lib/node_modules/meteor-hero/index.js:13:5)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)

  Run meteor-hero -h to see the full help menu and list of options

  If all else fails go to https://github.com/jkrup/meteor-hero/issues and post an issue there.

$ meteor --version       
Meteor 1.10.2

node version is v12.10.0, but I get the same error when I downgrade to 8.10.

How do we use this in a production environment?

2 main concerns:

  • custom domains
    • How do we use custom domains?
  • Scaling up / multiple instances
    • How do we use multiple instances with sticky sessions, etc

I'd like to be able to use this (or something similar) as a meteor-now alternative, in production, now that Zeit is forcefully sunsetting Now v1.

Dockerfile created with wrong node version

for some reason meteor-hero creates the dockerfile with node:8 and naturally meteor needs at least 14 to run. my meteor node -v returns 14.7, my general node -v is 14.6.

TypeError: logger.error is not a function

HI Justin,

I have contacted you on Snapchat to discuss the above before raising it as a possible bug - Currently trying to run Meteor-hero on a small meteor app and facing the below issue.

meteor --version
Meteor 1.8.1
On MINGW64 (W10/GIT Bash)

$meteor-hero
clearing build folder
Building meteor app...
Building meteor app (this can take several minutes)
build: too many arguments.
Usage: meteor build <output path> [--debug] [--directory] [--server-only]
          [--mobile-settings settings.json] [--server http://example.com:3000]

Package this project up for deployment. The command outputs a directory with
builds for all platforms in this project.

If you have added mobile platforms to your project with the
'meteor add-platform' command, then the output directory will contain
subdirectories named 'android' (with the APK bundle and Android project
source) and/or 'ios' (with the Xcode project source).

Pass `--server-only` to skip building mobile apps, but still build the
'web.cordova' client target so the server can support hot code push
for Cordova apps.

The output directory will contain a tarball that includes everything necessary
to run the application server. (See README in the tarball for details.)

Options:
  --debug             Build in debug mode (don't minify, etc).
  --directory         Output a directory (rather than a tarball) for the
                      application server bundle. If the output location exists,
                      it will be recursively deleted first.
  --server-only       Skip building mobile apps even if mobile platforms have
                      been added.
  --mobile-settings   Set optional data for the initial value of Meteor.settings
                      in your mobile application. A new value for
                      Meteor.settings can be set later by the server as part of
                      hot code push.
  --server            Location where mobile builds connect to the Meteor server.
                      Defaults to localhost:3000. Can include a URL scheme
                      (for example, --server=https://example.com:443).
  --architecture      Builds the server for a different architecture than your
                      developer machine's architecture. Valid architectures
                      include os.osx.x86_64, os.linux.x86_64, os.linux.x86_32,
                      os.windows.x86_32, and os.windows.x86_64. Note: This
                      option selects the architecture of the binary-dependent
                      Atmosphere packages you would like bundled into your
                      application, when those packages were specifically
                      published for multiple architectures (i.e. with meteor
                      publish-for-arch). If your project doesn't use any
                      Atmosphere packages that have binary dependencies,
                      --architecture has no effect.
  --allow-incompatible-update   Allow packages in your project to be upgraded or
                      downgraded to versions that are potentially incompatible
                      with the current versions, if required to satisfy all
                      package version constraints.

  🚨 Something happened that probably shouldn't have.

  Details:
    TypeError: logger.error is not a function
    at buildMeteorApp (C:\Users\NIM\AppData\Roaming\npm\node_modules\meteor-hero\commands\newDeploy.js:45:12)
    at newDeploy (C:\Users\NIM\AppData\Roaming\npm\node_modules\meteor-hero\commands\newDeploy.js:154:3)
    at Object.<anonymous> (C:\Users\NIM\AppData\Roaming\npm\node_modules\meteor-hero\index.js:13:5)
    at Module._compile (internal/modules/cjs/loader.js:1201:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
    at Module.load (internal/modules/cjs/loader.js:1050:32)
    at Function.Module._load (internal/modules/cjs/loader.js:938:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.