install.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 ./denmark
  27. cd ./denmark
  28. # Clone repositorires
  29. git clone $FRONTEND frontend
  30. git clone $BACKEND backend
  31. if [ $args = '--dev' ]; then
  32. cd frontend && git checkout development && cd ..
  33. cd backend && git checkout develop && cd ..
  34. fi
  35. }
  36. main $*