Commit 082efad2 authored by Miloš Diviš's avatar Miloš Diviš
Browse files

added condition if production config exists

parent fd0c4ee3
# /bin/bash
# Deply script for Nette application
# Deploy script for Nette application
#
# minified nette version expected in ./Nette-minified/nette.min.php
# -d to delete logs and html exceptions on server
# config.local.neon replaced by config.production.neon on production server
#
# setup
......@@ -45,7 +46,7 @@ scp -q -i $key_path $user@$server:$remote_dir/www/index.php temp/
# set maintance mode if app is on remote
if [ -f temp/index.php ]
then
then
sed -i "s/\/\/\s*require '.maintenance.php';/require '.maintenance.php';/" \
temp/index.php
......@@ -76,13 +77,18 @@ rsync -az \
rm exclude.txt
echo ' * sending production config'
cp app/config/config.production.neon temp/config.local.neon
rsync -az \
temp/config.local.neon $user@$server:$remote_dir/app/config/
rm temp/config.local.neon
if [ -f app/config/config.production.neon ]
then
echo ' * sending production config'
cp app/config/config.production.neon temp/config.local.neon
rsync -az \
temp/config.local.neon $user@$server:$remote_dir/app/config/
rm temp/config.local.neon
else
echo ' i Production config not found'
fi
echo ' * sending index.php'
rsync -az \
......@@ -91,7 +97,7 @@ www/index.php $user@$server:$remote_dir/www/
echo '* rsync completed, maitenance mode off.'
if [ $delete_logs -eq 1 ]
then
then
echo '* removing logs and stored exceptions'
sftp -q -i $key_path $user@$server >/dev/null 2>&1 << SFTPDELIM
cd $remote_dir
......
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