Commit 8d9eb053 authored by Miloš Diviš's avatar Miloš Diviš
Browse files

local paths corrected

parent 6864be0d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# setup # setup
server='k-architekt.cz' server='aaaa'
remote_dir='/www/' remote_dir='/www/'
rsync_exclude=('/www/images/uploads/*') rsync_exclude=('/www/images/uploads/*')
...@@ -11,14 +11,17 @@ common_exclude=('*.ssh' '/temp/*' '/log/*' '/nbproject' '/.git' '.gitignore' 'co ...@@ -11,14 +11,17 @@ common_exclude=('*.ssh' '/temp/*' '/log/*' '/nbproject' '/.git' '.gitignore' 'co
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $current_dir
# set maintenance mode # set maintenance mode
echo '* setting maintenance mode on remote app'
rsync -v --dry-run \ rsync -v --dry-run \
"$server:$remote_dir/www/index.php $current_dir/temp/" "$server:$remote_dir/www/index.php temp/"
sed -i "s/\/\/\s*require '.maintenance.php';/require '.maintenance.php';/" index.php sed -i "s/\/\/\s*require '.maintenance.php';/require '.maintenance.php';/" index.php
rsync -v --dry-run \ rsync -v --dry-run \
$current_dir/temp/index.php "$server:$remote_dir/www/" "temp/index.php $server:$remote_dir/www/"
# create exclude text file # create exclude text file
for i in "${rsync_exclude[@]}" for i in "${rsync_exclude[@]}"
...@@ -30,24 +33,22 @@ do ...@@ -30,24 +33,22 @@ do
echo $i >> exclude.txt echo $i >> exclude.txt
done done
### echo `cat exclude.txt`
echo 'Starting rsync to $server:$target_dir/test/' echo '* Starting rsync to $server:$target_dir/test/'
rsync -v --dry-run \ rsync -v --dry-run \
-r --delete \ -r --delete \
--fileter "P log/*.log" --filter "P log/*.html" \ --filter "P log/*.log" --filter "P log/*.html" \
--include ".htaccess" --exclude-from exclude.txt \ --include ".htaccess" --exclude-from exclude.txt \
$current_dir/ "$current_dir/moved/" "." "moved/"
# $current_dir/ "$server:$target_dir/test/" # . "$server:$target_dir/test/"
rm exclude.txt rm exclude.txt
# unset maintenance mode # unset maintenance mode
rsync -v --dry-run \ echo '* unsetting maintenance mode on remote app'
"$server:$remote_dir/www/index.php $current_dir/temp/"
sed -i "s/\s*require '.maintenance.php';/\/\/ require '.maintenance.php';/" index.php sed -i "s/\s*require '.maintenance.php';/\/\/ require '.maintenance.php';/" index.php
rsync -v --dry-run \ rsync -v --dry-run \
$current_dir/temp/index.php "$server:$remote_dir/www/" temp/index.php "$server:$remote_dir/www/"
rm temp/index.php
<?php <?php
// Uncomment this line if you must temporarily take down your site for maintenance. // Uncomment this line if you must temporarily take down your site for maintenance.
require '.maintenance.php'; // require '.maintenance.php';
// Let bootstrap create Dependency Injection container. // Let bootstrap create Dependency Injection container.
$container = require __DIR__ . '/../app/bootstrap.php'; $container = require __DIR__ . '/../app/bootstrap.php';
......
Markdown is supported
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