Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. function dc() {(
  2. if [[ $# -eq 0 || $# -gt 2 ]]; then
  3. echo -e "\nuso:\n\tdc [comando]\n\tdc [proyecto] [comando]\n"
  4. return
  5. fi
  6.  
  7. cmd=$1
  8. if [[ $# -eq 2 ]]; then
  9. cd ~/git/$1/laradock
  10. cmd=$2
  11. else
  12. cd laradock
  13. fi
  14.  
  15. if [[ "$cmd" == "up" ]]; then
  16. docker-compose up -d nginx mysql
  17. elif [[ "$cmd" == "ssh" ]]; then
  18. docker-compose exec workspace bash
  19. elif [[ "$cmd" == "restart" ]]; then
  20. docker-compose down && docker-compose build nginx mysql && docker-compose up -d nginx mysql
  21. else
  22. docker-compose $cmd
  23. fi
  24. )}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement