Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dc() {(
- if [[ $# -eq 0 || $# -gt 2 ]]; then
- echo -e "\nuso:\n\tdc [comando]\n\tdc [proyecto] [comando]\n"
- return
- fi
- cmd=$1
- if [[ $# -eq 2 ]]; then
- cd ~/git/$1/laradock
- cmd=$2
- else
- cd laradock
- fi
- if [[ "$cmd" == "up" ]]; then
- docker-compose up -d nginx mysql
- elif [[ "$cmd" == "ssh" ]]; then
- docker-compose exec workspace bash
- elif [[ "$cmd" == "restart" ]]; then
- docker-compose down && docker-compose build nginx mysql && docker-compose up -d nginx mysql
- else
- docker-compose $cmd
- fi
- )}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement