#!/bin/bash # Make the script exit on any error set -e set -o errexit DEBIAN_FRONTEND=noninteractive FRONTEND="ssh://git@git.grupomerelec.com:10022/onunez/soma-frontend.git" BACKEND="ssh://git@git.grupomerelec.com:10022/MERELEC/ME_EMS_API.git" function main { args=$1 if [ -z $args ]; then echo 'usage: install [] install: try ''`install --help`'' for more information ' exit fi if [ $args = '--help' ]; then echo 'usage: install [] Options: --dev Install from development branch of repos --prod Install from master branch of repos --help This help ' exit fi # Se crean las carpetas en donde se clonarán los repositorios mkdir ./app && cd ./app # Clone repositorires git clone $FRONTEND frontend git clone $BACKEND backend if [ $args = '--dev' ]; then cd frontend && git checkout development && cd .. cd backend && git checkout develop && cd .. fi docker-compose -d up . } main $*