Praqma / staci

Containerizing the Atlassian tools stack. Jira, Confluence, Bamboo and a MySQL database.
MIT License
12 stars 5 forks source link

Handle dependencies during install #44

Closed TheDukeDK closed 8 years ago

TheDukeDK commented 8 years ago

Running ./staci.sh install we assume that docker is setup properly on the host. Don't we? Or have I misunderstood?

martinmosegaard commented 8 years ago

Good point. Currently, there are lots of assumptions and not always helpful error messages when these are not met.

martinmosegaard commented 8 years ago

A first option could be to just check for dependencies and error out if they are not present.

TheDukeDK commented 8 years ago

Agreed, that would be a good first step. Error out the missing dependency, with maybe a link to help them along :-)

TheDukeDK commented 8 years ago

The dependency handling should, of course, know supported version. As an example my docker version is too old :-P

hoeghh commented 8 years ago

Finding out if docker, compose and machine is installed is easy. Like this for docker :

DOCKER_PATH=$(which docker) if [ ! -z "$DOCKER_PATH" ]; then echo "Docker is installed" fi

Docker and docker-compose has a function that prints its version in a pretty format. like : docker version --format '{{.Client.Version}}'

and : docker-compose version --short

But docker-machine does not. So its not pretty. The closest it could get, is this : docker-machine version | cut -d"," -f1|cut -d" " -f3

Then we need a function that can compare these with supported versions. Any ideas?

I thing we should create a function file called sanity.f or something in $STACI_HOME/functions/, and then start small and build on that with more and more tests. These versions check is important, so they make a good starting point.

hoeghh commented 8 years ago

I have pushed some code for testing.

@praqmaTim could you test this?

cd staci
cd functions
source tools.f
source system.f
check_docker_dependencies

If it works, then i will add it to the install function.

I get :

 - Running dependency checks, please wait...
  - Docker version          : 1.11.1 - OK
  - Docker-compose version  : 1.6.0  - OK
  - Docker-machine version  : 0.6.0  - OK
hoeghh commented 8 years ago

Fixed by #47