diff --git a/README.md b/README.md
index cbf83c21..bc7fe282 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
Meteor Up is a command line tool that allows you to deploy any [Meteor](http://meteor.com) app to your own server.
-You can install and use Meteor Up on Linux, Mac and Windows. It can deploy to servers running Ubuntu 14 or newer.
+You can install and use Meteor Up on Linux, Mac and Windows. It can deploy to servers running Ubuntu 14 or newer and CentOS 7 or newer.
This version of Meteor Up is powered by [Docker](http://www.docker.com/), making deployment easy to manage and reducing server specific errors.
@@ -86,5 +86,3 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
-
-
diff --git a/src/plugins/default/command-handlers.js b/src/plugins/default/command-handlers.js
index ec3528e1..9ba157a1 100644
--- a/src/plugins/default/command-handlers.js
+++ b/src/plugins/default/command-handlers.js
@@ -113,14 +113,14 @@ export function validate(api) {
function statusColor(
versionCorrect,
distributionCorrect,
- hasAptGet,
+ hasPackageManager,
defaultBash,
_overallColor
) {
let color = chalk.green;
let overallColor = _overallColor;
- if (!hasAptGet) {
+ if (!hasPackageManager) {
color = chalk.red;
overallColor = 'red';
} else if (!distributionCorrect) {
@@ -146,7 +146,7 @@ export async function status(api) {
const servers = Object.values(api.getConfig().servers);
const lines = [];
let overallColor = 'green';
- const command = 'lsb_release -r -s || echo "false"; lsb_release -is; apt-get -v &> /dev/null && echo "true" || echo "false"; echo $BASH';
+ const command = 'lsb_release -r -s || echo "false"; lsb_release -is; apt-get -v &> /dev/null && echo "true" || echo "false"; yum -h &> /dev/null && echo "true" || echo "false"; echo $BASH';
const results = await map(
servers,
server => api.runSSHCommand(server, command),
@@ -160,18 +160,26 @@ export async function status(api) {
version,
distribution,
aptGet,
+ yum,
bash = ''
] = output.trim().split('\n');
- const versionCorrect = parseInt(version, 10) > 13;
- const distributionCorrect = distribution === 'Ubuntu';
- const hasAptGet = aptGet.trim() === 'true';
+ let versionCorrect = false;
+ let distributionCorrect = false;
+ if (distribution === 'CentOS') {
+ distributionCorrect = true;
+ versionCorrect = parseInt(version, 10) >= 7;
+ } else if (distribution === 'Ubuntu') {
+ distributionCorrect = true;
+ versionCorrect = parseInt(version, 10) > 13;
+ }
+ const hasPackageManager = aptGet.trim() === 'true' || yum.trim() === 'true';
const defaultBash = bash.trim().length > 0;
const colors = statusColor(
versionCorrect,
distributionCorrect,
- hasAptGet,
+ hasPackageManager,
defaultBash,
overallColor
);
@@ -180,8 +188,8 @@ export async function status(api) {
overallColor = colors.overallColor;
text += color(`${distribution} ${version}`);
- if (!hasAptGet) {
- text += chalk.red(' apt-get not available');
+ if (!hasPackageManager) {
+ text += chalk.red(' package manager (yum or apt-get) not available');
}
if (!defaultBash) {
diff --git a/src/plugins/docker/assets/docker-setup.sh b/src/plugins/docker/assets/docker-setup.sh
index d37f539f..e4b7fae7 100644
--- a/src/plugins/docker/assets/docker-setup.sh
+++ b/src/plugins/docker/assets/docker-setup.sh
@@ -5,19 +5,33 @@
install_docker () {
# Remove the lock
set +e
- sudo rm /var/lib/dpkg/lock > /dev/null
- sudo rm /var/cache/apt/archives/lock > /dev/null
- sudo dpkg --configure -a
- set -e
-
- # Required to update system
- sudo apt-get update
- sudo apt-get -y install wget lxc iptables curl
-
- # Install docker
- wget -qO- https://get.docker.com/ | sudo sh
- sudo usermod -a -G docker ${USER}
+ if lsb_release -is > /dev/null
+ then
+ # Required to update Ubuntu system
+ sudo rm /var/lib/dpkg/lock > /dev/null
+ sudo rm /var/cache/apt/archives/lock > /dev/null
+ sudo dpkg --configure -a
+ set -e
+ sudo apt-get update
+ sudo apt-get -y install wget lxc iptables curl
+ # Install docker
+ wget -qO- https://get.docker.com/ | sudo sh
+ sudo usermod -a -G docker ${USER}
+ else
+ # Required to update CentOS system
+ sudo rm -f /var/run/yum.pid > /dev/null
+ sudo yum clean all > /dev/null
+ set -e
+ sudo yum -y update
+ sudo yum -y install wget lxc iptables curl redhat-lsb-core initscripts
+ # Install docker
+ wget -qO- https://get.docker.com/ | sudo sh
+ sudo usermod -a -G docker ${USER}
+ # start docker on boot
+ sudo chkconfig docker on
+ fi
+ # start docker service
sudo service docker start || sudo service docker restart
}