Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Miloš Diviš
deploy script
Commits
e75a5f06
Commit
e75a5f06
authored
Mar 17, 2014
by
Miloš Diviš
Browse files
maintance mode corrected
parent
f2857dac
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy.sh
View file @
e75a5f06
...
...
@@ -6,7 +6,8 @@ server='aaaa'
remote_dir
=
'/www/'
rsync_exclude
=(
'/www/images/uploads/*'
)
common_exclude
=(
'*.ssh'
'/temp/*'
'/log/*'
'/nbproject'
'/.git'
'.gitignore'
'composer.json'
)
# index.php excluded and send last because of maintenance mode
common_exclude
=(
'*.ssh'
'/temp/*'
'/log/*'
'/nbproject'
'/.git'
'.gitignore'
'composer.json'
'/www/index.php'
)
current_dir
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
...
...
@@ -22,6 +23,7 @@ sed -i "s/\/\/\s*require '.maintenance.php';/require '.maintenance.php';/" index
rsync
-v
--dry-run
\
"temp/index.php
$server
:
$remote_dir
/www/"
rm
temp/index.php
# create exclude text file
for
i
in
"
${
rsync_exclude
[@]
}
"
...
...
@@ -44,11 +46,10 @@ rsync -v --dry-run \
rm
exclude.txt
# unset maintenance mode
echo
'* unsetting maintenance mode on remote app'
sed
-i
"s/
\s
*require '.maintenance.php';/
\/\/
require '.maintenance.php';/"
index.php
echo
'* files uploaded. Sending index.php'
rsync
-v
--dry-run
\
temp/index.php
"
$server
:
$remote_dir
/www/"
rm
temp/index.php
www/index.php
"
$server
:
$remote_dir
/www/"
echo
'* maintance mode off. files uploaded'
Write
Preview
Supports
Markdown
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