From 67676f35fb7d9f129562e67ed1656dba71bc39c9 Mon Sep 17 00:00:00 2001 From: Marc Singer Date: Tue, 26 Nov 2019 13:40:48 +0100 Subject: [PATCH] Adding a setup script for easier deployment --- setup.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 setup.sh diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..69b11c8 --- /dev/null +++ b/setup.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +### Checking for docker, docker-compose and git as requirements +### Show a warning when requirements are not installed +which docker || echo "Please install docker on your system" & exit 1 +which docker-compose || echo "Please install docker-compose on your system" & exit 1 +which git || echo "Please install git on your system" & exit 1 + +### Cloning repositories +### Docker specifics +git clone https://github.com/nxt-engineering/hitobito-docker.git hitobito +### Hitobito Core Project +git clone https://github.com/hitobito/hitobito.git hitobito/hitobito +### Hitobito Wagon project(s) +git clone https://github.com/hitobito/hitobito_generic.git hitobito/hitobito_generic + +### Running the docker containers +cd hitobito +docker-compose up app + +### Output App URI(s) +echo "http://$(docker-compose port app 3000)" +echo "http://$(docker-compose port mail 1080)" + +### Setting up first user account +echo 'p=Person.first; p.update(password: "password"); "You can now login as #{p.email} with the password \"password\""' | docker-compose run --rm -T app rails c \ No newline at end of file