#/bin/bash echo "================= rsync files ================="; rsync -av --delete --exclude=vendor --exclude=runtime /data/project/service/ /home/project/service; echo "" while getopts "io" opt; do case $opt in i) echo "================= composer install ================="; echo "dist:" cd /home/project/service; composer install; echo "" echo "source:" cd /data/project/service; composer install; echo "" ;; o) echo "================= composer dump-autoload -o ================="; echo "dist:" cd /home/project/service; composer dump-autoload -o; echo "" echo "source:" cd /data/project/service; composer dump-autoload -o; echo "" ;; \?) echo "Invalid option: -$OPTARG" echo "" ;; esac done echo "================= start service ================="; cd /home/project/service; php bin/hyperf.php start;