Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 1 | UBUNTU:=$(shell which apt > /dev/null 2>&1; echo $$?) |
| 2 | |
| 3 | ifeq ($(UBUNTU),0) |
| 4 | |
| 5 | # ******************* apt-based distros *************************** |
| 6 | prereqs: /usr/bin/http docker /usr/bin/curl /usr/local/bin/docker-compose |
| 7 | |
| 8 | /usr/bin/http: |
| 9 | sudo apt-get -y install httpie |
| 10 | |
| 11 | /usr/bin/curl: |
| 12 | sudo apt-get -y install curl |
| 13 | |
| 14 | docker: |
| 15 | which docker > /dev/null || wget -qO- https://get.docker.com/ | sh |
| 16 | sudo usermod -aG docker $(shell whoami) |
| 17 | |
| 18 | else |
| 19 | |
| 20 | # ****************** RPM-based distros ****************** |
| 21 | |
| 22 | # (untested / work-in-progress) |
| 23 | |
| 24 | prereqs: /usr/bin/pip /usr/bin/http docker /usr/local/bin/docker-compose |
| 25 | |
| 26 | /usr/bin/pip: |
| 27 | curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" |
| 28 | sudo python ./get-pip.py |
| 29 | |
| 30 | docker: |
| 31 | which docker > /dev/null || wget -qO- https://get.docker.com/ | sh |
| 32 | sudo usermod -aG docker $(shell whoami) |
| 33 | |
| 34 | /usr/bin/http: |
| 35 | sudo pip install httpie |
| 36 | |
| 37 | endif |
| 38 | |
| 39 | /usr/local/bin/docker-compose: |
| 40 | sudo bash -c "curl -L https://github.com/docker/compose/releases/download/1.5.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose" |
| 41 | sudo chmod +x /usr/local/bin/docker-compose |