Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ Meteor Up uses Docker to run and manage your app. It uses [MeteorD](https://gith

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

#### Using a custom docker image

The default docker image (MeteorD) can be overridden by setting `dockerImage`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is mup.json file. Not the settings.json file.
Also, show a code sample on to do it. Just having the dockerImage key is enough.

Also, add a link to to MeteorD

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be you can link also another document on how to extend MeteorD. May be a blog post of yours.
Anyway, that can be done later.

in the settings.json file. This image should be based off of meteord to
ensure compatibility.

#### Multiple Deployment Targets

You can use an array to deploy to multiple servers at once.
Expand Down
7 changes: 5 additions & 2 deletions example/mup.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
// Install MongoDB on the server. Does not destroy the local MongoDB on future setups
"setupMongo": true,

// Docker image to use
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove it from here.

"dockerImage": "meteorhacks/meteord:base",

// Application name (no spaces).
"appName": "meteor",

Expand All @@ -37,7 +40,7 @@
// Before mup checks that, it will wait for the number of seconds configured below.
"deployCheckWaitTime": 15,

// show a progress bar while uploading.
// show a progress bar while uploading.
// Make it false when you deploy using a CI box.
"enableUploadProgressBar": true
}
}
10 changes: 7 additions & 3 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ exports.read = function(configFileName) {
mupJson.appName = "meteor";
}

if(typeof mupJson.dockerImage === "undefined") {
mupJson.dockerImage = "meteorhacks/meteord:base";
}

if(typeof mupJson.enableUploadProgressBar === "undefined") {
mupJson.enableUploadProgressBar = true;
}
Expand Down Expand Up @@ -94,12 +98,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;
Expand Down Expand Up @@ -127,4 +131,4 @@ exports.read = function(configFileName) {
console.error(errorMessage.red.bold);
process.exit(1);
}
};
};
3 changes: 2 additions & 1 deletion lib/taskLists/linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ exports.deploy = function(bundlePath, env, config) {
dest: '/opt/' + appName + '/config/start.sh',
vars: {
appName: appName,
dockerImage: config.dockerImage,
useLocalMongo: config.setupMongo,
port: env.PORT,
sslConfig: config.ssl
Expand Down Expand Up @@ -189,4 +190,4 @@ function deployAndVerify(taskList, appName, port, deployCheckWaitTime) {
port: port
}
});
}
}
9 changes: 5 additions & 4 deletions templates/linux/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ BUNDLE_PATH=$APP_PATH/current
ENV_FILE=$APP_PATH/config/env.list
PORT=<%= port %>
USE_LOCAL_MONGO=<%= useLocalMongo? "1" : "0" %>
DOCKERIMAGE=<%= dockerImage %>

# Remove previous version of the app, if exists
docker rm -f $APPNAME
Expand All @@ -15,7 +16,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 $DOCKERIMAGE
set -e

if [ "$USE_LOCAL_MONGO" == "1" ]; then
Expand All @@ -29,7 +30,7 @@ if [ "$USE_LOCAL_MONGO" == "1" ]; then
--hostname="$HOSTNAME-$APPNAME" \
--env=MONGO_URL=mongodb://mongodb:27017/$APPNAME \
--name=$APPNAME \
meteorhacks/meteord:base
$DOCKERIMAGE
else
docker run \
-d \
Expand All @@ -39,7 +40,7 @@ else
--hostname="$HOSTNAME-$APPNAME" \
--env-file=$ENV_FILE \
--name=$APPNAME \
meteorhacks/meteord:base
$DOCKERIMAGE
fi

<% if(typeof sslConfig === "object") { %>
Expand All @@ -56,4 +57,4 @@ fi
--publish=<%= sslConfig.port %>:443 \
--name=$APPNAME-frontend \
meteorhacks/mup-frontend-server /start.sh
<% } %>
<% } %>