#!/bin/bash
Ip="was.baoshi56.com"
username="haozi"
password="haozi"
files=("app" "config" "database" "public" "resources" "routes" "webpack.mix.js" "composer.json" "tests")
src=/var/www/bswas_test_
dsc=/var/www/was
cd $src
for i in ${files[*]}
do
expect -c "
spawn scp -P 10022 -r $username@$Ip:$dsc/$i $src/
expect {
\"*assword\" {set timeout 120; send \"$password\r\";}
\"yes/no\" {send \"yes\r\"; exp_continue;}
}
expect eof"
done
npm run dev
php artisan migrate
composer update
