diff --git a/README.md b/README.md index 834dc77..c722672 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -# Meteor Up X (Stable Version) - -> The latest development version of mup is https://github.com/kadirahq/meteor-up. +# Meteor Up Dockerized (Stable Version) #### Production Quality Meteor Deployments @@ -54,13 +52,13 @@ This version of Meteor Up is powered by [Docker](http://www.docker.com/) and it ### Installation - npm install -g mupx + npm install -g mupd ### Creating a Meteor Up Project mkdir ~/my-meteor-deployment cd ~/my-meteor-deployment - mupx init + mupd init This will create two files in your Meteor Up project directory: @@ -91,6 +89,8 @@ This will create two files in your Meteor Up project directory: // Install MongoDB on the server. Does not destroy the local MongoDB on future setups "setupMongo": true, + // Set MongoDB version, check what version of Mongo you are using in development "meteor mongo" + "mongoVersion": 2.6.7, // Application name (no spaces). "appName": "meteor", @@ -119,23 +119,23 @@ This will create two files in your Meteor Up project directory: ### Setting Up a Server - mupx setup + mupd setup -This will setup the server for the `mupx` deployments. It will take around 2-5 minutes depending on the server's performance and network availability. +This will setup the server for the `mupd` deployments. It will take around 2-5 minutes depending on the server's performance and network availability. ### Deploying an App - mupx deploy + mupd deploy This will bundle the Meteor project and deploy it to the server. Bundling process is very similar to how `meteor deploy` do it. ### Other Utility Commands -* `mupx reconfig` - reconfigure app with new environment variables and Meteor settings -* `mupx stop` - stop the app -* `mupx start` - start the app -* `mupx restart` - restart the app -* `mupx logs [-f --tail=50]` - get logs +* `mupd reconfig` - reconfigure app with new environment variables and Meteor settings +* `mupd stop` - stop the app +* `mupd start` - start the app +* `mupd restart` - restart the app +* `mupd logs [-f --tail=50]` - get logs ### Build Options @@ -217,7 +217,7 @@ Meteor Up uses Docker to run and manage your app. It uses [MeteorD](https://gith * If you decided to use MongoDB, it'll be also running as a Docker conatiner. It's bound to the local interface and port 27017 (you cannot access from the outside) * the database is named `` -For more information see [`lib/taskLists.js`](https://github.com/arunoda/meteor-up/blob/mupx/lib/taskLists/linux.js). +For more information see [`lib/taskLists.js`](https://github.com/arunoda/meteor-up/blob/mupd/lib/taskLists/linux.js). #### Multiple Deployment Targets @@ -303,29 +303,29 @@ To learn more about the SSL setup refer to the [`mup-frontend-server`](https://g ### Updating Mup -To update `mupx` to the latest version, just type: +To update `mupd` to the latest version, just type: - npm update mupx -g + npm update mupd -g -You should try and keep `mupx` up to date in order to keep up with the latest Meteor changes. +You should try and keep `mupd` up to date in order to keep up with the latest Meteor changes. ### Troubleshooting #### Check Logs -If you suddenly can't deploy your app anymore, first use the `mupx logs -f` command to check the logs for error messages. +If you suddenly can't deploy your app anymore, first use the `mupd logs -f` command to check the logs for error messages. One of the most common problems is your Node version getting out of date. In that case, see “Updating” section above. #### Verbose Output -If you need to see the output of `mupx` (to see more precisely where it's failing or hanging, for example), run it like so: +If you need to see the output of `mupd` (to see more precisely where it's failing or hanging, for example), run it like so: - DEBUG=* mupx + DEBUG=* mupd -where `` is one of the `mupx` commands such as `setup`, `deploy`, etc. +where `` is one of the `mupd` commands such as `setup`, `deploy`, etc. ### Migrating from Meteor Up 0.x -`mupx` is not fully backward compatible with Meteor Up 0.x. But most of the `mup.json` remain the same. Here are some of the changes: +`mupd` is not fully backward compatible with Meteor Up 0.x. But most of the `mup.json` remain the same. Here are some of the changes: * Docker is the now runtime for Meteor Up * We don't have use Upstart any more @@ -347,4 +347,4 @@ Let's assume our appName is `meteor` * Stop mongodb if you are using: `stop mongod` * Remove MongoDB with: `apt-get remove mongodb` -Then do `mupx setup` and then `mupx deploy`. +Then do `mupd setup` and then `mupd deploy`. diff --git a/lib/actions.js b/lib/actions.js index fd131d6..91d421f 100644 --- a/lib/actions.js +++ b/lib/actions.js @@ -61,22 +61,6 @@ Actions.prototype._createSessionsMap = function(config) { return sessionsMap; }; -var kadiraRegex = /^meteorhacks:kadira/m; -Actions.prototype._showKadiraLink = function() { - var versionsFile = path.join(this.config.app, '.meteor/versions'); - if(fs.existsSync(versionsFile)) { - var packages = fs.readFileSync(versionsFile, 'utf-8'); - var hasKadira = kadiraRegex.test(packages); - if(!hasKadira) { - console.log( - "“ Checkout " + "Kadira".bold + "!"+ - "\n It's the best way to monitor performance of your app."+ - "\n Visit: " + "https://kadira.io/mup".underline + " ”\n" - ); - } - } -} - Actions.prototype._executePararell = function(actionName, args) { var self = this; var sessionInfoList = _.values(self.sessionsMap); @@ -94,13 +78,11 @@ Actions.prototype._executePararell = function(actionName, args) { }; Actions.prototype.setup = function() { - this._showKadiraLink(); this._executePararell("setup", [this.config]); }; Actions.prototype.deploy = function() { var self = this; - self._showKadiraLink(); var buildLocation = path.resolve('/tmp', uuid.v4()); var bundlePath = path.resolve(buildLocation, 'bundle.tar.gz'); diff --git a/lib/config.js b/lib/config.js index 0b931a1..6e5f7cc 100644 --- a/lib/config.js +++ b/lib/config.js @@ -18,6 +18,9 @@ exports.read = function(configFileName) { mupJson.env = mupJson.env || {}; mupJson.env['PORT'] = mupJson.env['PORT'] || 80; + // Get mongo version or default to 2.6.7 + mupJson.mongoVersion = mupJson.mongoVersion || "2.6.7" + if(typeof mupJson.setupNode === "undefined") { mupJson.setupNode = true; } @@ -94,12 +97,12 @@ exports.read = function(configFileName) { helpers.printHelp(); process.exit(1); } - + function rewritePath(location, errorMessage) { if(!location) { return mupErrorLog(errorMessage); } - + var homeLocation = process.env.HOME; if(/^win/.test(process.platform)) { homeLocation = process.env.USERPROFILE; @@ -127,4 +130,4 @@ exports.read = function(configFileName) { console.error(errorMessage.red.bold); process.exit(1); } -}; \ No newline at end of file +}; diff --git a/lib/taskLists/linux.js b/lib/taskLists/linux.js index 2bbbe0d..f85ff77 100644 --- a/lib/taskLists/linux.js +++ b/lib/taskLists/linux.js @@ -28,7 +28,10 @@ exports.setup = function(config) { }); taskList.executeScript('Installing MongoDB', { - script: path.resolve(SCRIPT_DIR, 'install-mongodb.sh') + script: path.resolve(SCRIPT_DIR, 'install-mongodb.sh'), + vars: { + mongoVersion: config.mongoVersion + } }); } @@ -189,4 +192,4 @@ function deployAndVerify(taskList, appName, port, deployCheckWaitTime) { port: port } }); -} \ No newline at end of file +} diff --git a/package.json b/package.json index 25c89df..3a3efe7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "mupx", - "version": "1.5.2", + "name": "mupd", + "version": "1.5.6", "description": "Production Quality Meteor Deployments", "dependencies": { "async": "^0.9.0", @@ -15,12 +15,12 @@ "minimist": "1.1.1" }, "bin": { - "mupx": "./bin/mup" + "mupd": "./bin/mup" }, - "author": "Arunoda Susiripala ", + "author": "Ville Jyrkkä ", "repository": { "type": "git", - "url": "git://github.com/arunoda/meteor-up.git" + "url": "git://github.com/jykae/meteor-up.git" }, "license": "MIT" } diff --git a/scripts/linux/install-mongodb.sh b/scripts/linux/install-mongodb.sh index a7ca03f..d975066 100644 --- a/scripts/linux/install-mongodb.sh +++ b/scripts/linux/install-mongodb.sh @@ -4,8 +4,8 @@ set -e # we use this data directory for the backward compatibility # older mup uses mongodb from apt-get and they used this data directory sudo mkdir -p /var/lib/mongodb +sudo docker pull mongo:<%= mongoVersion %> -sudo docker pull mongo:latest set +e sudo docker rm -f mongodb set -e @@ -17,4 +17,4 @@ sudo docker run \ --volume=/var/lib/mongodb:/data/db \ --volume=/opt/mongodb/mongodb.conf:/mongodb.conf \ --name=mongodb \ - mongo mongod -f /mongodb.conf \ No newline at end of file + mongo:<%= mongoVersion %> mongod -f /mongodb.conf diff --git a/templates/linux/start.sh b/templates/linux/start.sh index 2645942..8c6a41c 100644 --- a/templates/linux/start.sh +++ b/templates/linux/start.sh @@ -15,7 +15,7 @@ docker rm -f $APPNAME-frontend # We don't need to fail the deployment because of a docker hub downtime set +e -docker pull meteorhacks/meteord:base +docker pull abernix/meteord:base set -e if [ "$USE_LOCAL_MONGO" == "1" ]; then @@ -29,7 +29,7 @@ if [ "$USE_LOCAL_MONGO" == "1" ]; then --hostname="$HOSTNAME-$APPNAME" \ --env=MONGO_URL=mongodb://mongodb:27017/$APPNAME \ --name=$APPNAME \ - meteorhacks/meteord:base + abernix/meteord:base else docker run \ -d \ @@ -39,7 +39,7 @@ else --hostname="$HOSTNAME-$APPNAME" \ --env-file=$ENV_FILE \ --name=$APPNAME \ - meteorhacks/meteord:base + abernix/meteord:base fi <% if(typeof sslConfig === "object") { %> @@ -56,4 +56,4 @@ fi --publish=<%= sslConfig.port %>:443 \ --name=$APPNAME-frontend \ meteorhacks/mup-frontend-server /start.sh -<% } %> \ No newline at end of file +<% } %>