From c6da706e51c035c22e1d8a2390323f63a4036aca Mon Sep 17 00:00:00 2001 From: Dmitry Kuzmenkov Date: Mon, 20 Jul 2015 14:03:11 +0700 Subject: [PATCH] Remove default user from deploy. You must specify user in hosts file now --- .kissrc | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.kissrc b/.kissrc index b98082f..ca26870 100644 --- a/.kissrc +++ b/.kissrc @@ -294,7 +294,6 @@ deploy() { if [[ -z "$1" ]]; then echo 'Usage: deploy [all|production|test|...]' && return fi - user='web' host_file=$CONFIG_DIR/hosts if [[ ! -f $host_file ]]; then echo 'Create hosts file "'$host_file'" with hostnames to deploy on' @@ -330,29 +329,29 @@ deploy() { server=${server%:*} echo 'Deploying on server '$server':'$environment - scp $HOME/.kissrc $user@$server:/home/$user - ssh -T $user@$server <<"EOF" - /bin/cat $HOME/.bashrc | /bin/grep -v '#.kissrc$' > $HOME/.bashrc.tmp - echo "source $HOME/.kissrc #.kissrc" >> $HOME/.bashrc.tmp - /bin/mv $HOME/.bashrc.tmp $HOME/.bashrc - source $HOME/.bashrc + scp $HOME/.kissrc $server:~ + ssh -T $server <<"EOF" + /bin/cat ~/.bashrc | /bin/grep -v '#.kissrc$' > ~/.bashrc.tmp + echo "source ~/.kissrc #.kissrc" >> ~/.bashrc.tmp + /bin/mv ~/.bashrc.tmp ~/.bashrc + source ~/.bashrc EOF # Create dir if they do not exist - ssh -T $user@$server "mkdir -p /home/$user/$PROJECT/rev/$revision && test -L /home/$user/$PROJECT/app && cp -r \$_/* /home/$user/$PROJECT/rev/$revision" + ssh -T $server "mkdir -p ~/$PROJECT/rev/$revision && test -L ~/$PROJECT/app && cp -r \$_/* ~/$PROJECT/rev/$revision" # Create revision - rsync -aiz --delete-before $APP_DIR/ $user@$server:/home/$user/$PROJECT/rev/$revision/ + rsync -aiz --delete-before $APP_DIR/ $server:~/$PROJECT/rev/$revision/ # Compile PROJECT on server - ssh -T $user@$server < \$CONFIG_DIR/environment