Commit ff9347ce authored by Miloš Diviš's avatar Miloš Diviš
Browse files

working version of deploy script

parent cd38b93c
......@@ -2,8 +2,10 @@
# setup
server='aaaa'
remote_dir='/www/'
server='195.210.29.9'
user='k-architekt.cz'
remote_dir='/web'
key_path='/home/mario/.ssh/websupport_key'
rsync_exclude=('/www/images/uploads/*')
# index.php excluded and send last because of maintenance mode
......@@ -16,13 +18,13 @@ cd $current_dir
# set maintenance mode
echo '* setting maintenance mode on remote app'
rsync \
"$server:$remote_dir/www/index.php temp/"
sed -i "s/\/\/\s*require '.maintenance.php';/require '.maintenance.php';/" index.php
scp -i $key_path $user@$server:$remote_dir/www/index.php temp/
rsync \
"temp/index.php $server:$remote_dir/www/"
sed -i "s/\/\/\s*require '.maintenance.php';/require '.maintenance.php';/" temp/index.php
rsync -az \
temp/index.php $user@$server:$remote_dir/www/
rm temp/index.php
# create exclude text file
......@@ -36,19 +38,19 @@ echo $i >> exclude.txt
done
echo '* Starting rsync to $server:$target_dir/test/'
rsync \
-r --delete \
echo "* Starting rsync to $server:$remote_dir"
rsync -az \
--delete \
--filter "P log/*.log" --filter "P log/*.html" \
--include ".htaccess" --exclude-from exclude.txt \
. "$server:$target_dir"
. $user@$server:$remote_dir/
rm exclude.txt
echo '* files uploaded. Sending index.php'
rsync \
www/index.php "$server:$remote_dir/www/"
rsync -az \
www/index.php $user@$server:$remote_dir/www/
echo '* maintance mode off. files uploaded'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment