install.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. # Make the script exit on any error
  3. set -e
  4. set -o errexit
  5. DEBIAN_FRONTEND=noninteractive
  6. FRONTEND="ssh://git@git.grupomerelec.com:10022/onunez/soma-frontend.git"
  7. BACKEND="ssh://git@git.grupomerelec.com:10022/MERELEC/ME_EMS_API.git"
  8. function main {
  9. args=$1
  10. if [ -z $args ]; then
  11. echo 'usage: install [<opions>]
  12. install: try ''`install --help`'' for more information
  13. '
  14. exit
  15. fi
  16. if [ $args = '--help' ]; then
  17. echo 'usage: install [<opions>]
  18. Options:
  19. --dev Install from development branch of repos
  20. --prod Install from master branch of repos
  21. --help This help
  22. '
  23. exit
  24. fi
  25. # Se crean las carpetas en donde se clonarán los repositorios
  26. mkdir ./app && cd ./app
  27. # Clone repositorires
  28. git clone $FRONTEND frontend
  29. git clone $BACKEND backend
  30. if [ $args = '--dev' ]; then
  31. cd frontend && git checkout development && cd ..
  32. cd backend && git checkout develop && cd ..
  33. fi
  34. docker-compose -d up .
  35. }
  36. main $*