Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Miloš Diviš
deploy script
Commits
082efad2
Commit
082efad2
authored
Mar 19, 2014
by
Miloš Diviš
Browse files
added condition if production config exists
parent
fd0c4ee3
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy.sh
View file @
082efad2
# /bin/bash
# /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
# setup
server
=
'195.210.29.9'
server
=
'195.210.29.9'
...
@@ -45,7 +46,7 @@ scp -q -i $key_path $user@$server:$remote_dir/www/index.php temp/
...
@@ -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
# set maintance mode if app is on remote
if
[
-f
temp/index.php
]
if
[
-f
temp/index.php
]
then
then
sed
-i
"s/
\/\/\s
*require '.maintenance.php';/require '.maintenance.php';/"
\
sed
-i
"s/
\/\/\s
*require '.maintenance.php';/require '.maintenance.php';/"
\
temp/index.php
temp/index.php
...
@@ -76,13 +77,18 @@ rsync -az \
...
@@ -76,13 +77,18 @@ rsync -az \
rm
exclude.txt
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'
echo
' * sending index.php'
rsync
-az
\
rsync
-az
\
...
@@ -91,7 +97,7 @@ www/index.php $user@$server:$remote_dir/www/
...
@@ -91,7 +97,7 @@ www/index.php $user@$server:$remote_dir/www/
echo
'* rsync completed, maitenance mode off.'
echo
'* rsync completed, maitenance mode off.'
if
[
$delete_logs
-eq
1
]
if
[
$delete_logs
-eq
1
]
then
then
echo
'* removing logs and stored exceptions'
echo
'* removing logs and stored exceptions'
sftp
-q
-i
$key_path
$user
@
$server
>
/dev/null 2>&1
<<
SFTPDELIM
sftp
-q
-i
$key_path
$user
@
$server
>
/dev/null 2>&1
<<
SFTPDELIM
cd
$remote_dir
cd
$remote_dir
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment