Commit 6864be0d authored by Miloš Diviš's avatar Miloš Diviš
Browse files

initial commit

parents
# /bin/bash
# setup
server='k-architekt.cz'
remote_dir='/www/'
rsync_exclude=('/www/images/uploads/*')
common_exclude=('*.ssh' '/temp/*' '/log/*' '/nbproject' '/.git' '.gitignore' 'composer.json')
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# set maintenance mode
rsync -v --dry-run \
"$server:$remote_dir/www/index.php $current_dir/temp/"
sed -i "s/\/\/\s*require '.maintenance.php';/require '.maintenance.php';/" index.php
rsync -v --dry-run \
$current_dir/temp/index.php "$server:$remote_dir/www/"
# create exclude text file
for i in "${rsync_exclude[@]}"
do
echo $i >> exclude.txt
done
for i in "${common_exclude[@]}"
do
echo $i >> exclude.txt
done
### echo `cat exclude.txt`
echo 'Starting rsync to $server:$target_dir/test/'
rsync -v --dry-run \
-r --delete \
--fileter "P log/*.log" --filter "P log/*.html" \
--include ".htaccess" --exclude-from exclude.txt \
$current_dir/ "$current_dir/moved/"
# $current_dir/ "$server:$target_dir/test/"
rm exclude.txt
# unset maintenance mode
rsync -v --dry-run \
"$server:$remote_dir/www/index.php $current_dir/temp/"
sed -i "s/\s*require '.maintenance.php';/\/\/ require '.maintenance.php';/" index.php
rsync -v --dry-run \
$current_dir/temp/index.php "$server:$remote_dir/www/"
<?php
// Uncomment this line if you must temporarily take down your site for maintenance.
require '.maintenance.php';
// Let bootstrap create Dependency Injection container.
$container = require __DIR__ . '/../app/bootstrap.php';
// Run application.
$container->application->run();
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