#!/bin/bash

git clone https://github.com/ojacques/chatopslab.git

which curl docker make ruby || {
  sudo apt-get update
  sudo apt-get install -y curl docker.io make ruby
  sudo usermod -a -G docker ubuntu
  sudo gem install rubyzip
}

which docker-compose || {
  curl -sSL https://github.com/docker/compose/releases/download/1.9.0-rc2/docker-compose-`uname -s`-`uname -m` > docker-compose
  sudo mv docker-compose /usr/local/bin
  sudo chmod +x /usr/local/bin/docker-compose
}

which npm || {
  sudo apt-get install nodejs
  sudo apt-get install nodejs-legacy
  sudo apt-get install npm
}

which yo || {
  cd ~/chatopslab
  mkdir hubot && cd hubot
  sudo npm install -g yo generator-hubot
}

cd ~chatopslab/app
echo "Waiting for Docker daemon to start"
sleep 5
docker-compose create


#!/bin/bash

which curl docker make ruby || {
  sudo apt-get update
  sudo apt-get install -y curl docker.io make ruby
  sudo usermod -a -G docker ubuntu
  sudo gem install rubyzip
}

which docker-compose || {
  curl -sSL https://github.com/docker/compose/releases/download/1.9.0-rc2/docker-compose-`uname -s`-`uname -m` > docker-compose
  sudo cp docker-compose /usr/local/bin
  sudo chmod +x /usr/local/bin/docker-compose
}

git clone https://github.com/ojacques/chatopslab.git
cd chatopslab/app
docker-compose create

--- 
+++ 
@@ -1,4 +1,6 @@
 #!/bin/bash
+
+git clone https://github.com/ojacques/chatopslab.git
 
 which curl docker make ruby || {
   sudo apt-get update
@@ -9,10 +11,24 @@
 
 which docker-compose || {
   curl -sSL https://github.com/docker/compose/releases/download/1.9.0-rc2/docker-compose-`uname -s`-`uname -m` > docker-compose
-  sudo cp docker-compose /usr/local/bin
+  sudo mv docker-compose /usr/local/bin
   sudo chmod +x /usr/local/bin/docker-compose
 }
 
-git clone https://github.com/ojacques/chatopslab.git
-cd chatopslab/app
+which npm || {
+  sudo apt-get install nodejs
+  sudo apt-get install nodejs-legacy
+  sudo apt-get install npm
+}
+
+which yo || {
+  cd ~/chatopslab
+  mkdir hubot && cd hubot
+  sudo npm install -g yo generator-hubot
+}
+
+cd ~chatopslab/app
+echo "Waiting for Docker daemon to start"
+sleep 5
 docker-compose create
+
Add NodeJS install for hubot
