Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
BASH
(view source)
Revision as of 09:20, 3 April 2017
583 bytes added
,
09:20, 3 April 2017
→Check command success
Line 242:
Line 242:
<source lang="bash">#!/bin/bash
<source lang="bash">#!/bin/bash
+
###########################################
+
# Restart application services #
+
###########################################
+
OK="[\033[01;32m OK \033[01;36m]\033[01;00m"
OK="[\033[01;32m OK \033[01;36m]\033[01;00m"
FAIL="[\033[01;33m FAIL \033[01;36m]\033[01;00m"
FAIL="[\033[01;33m FAIL \033[01;36m]\033[01;00m"
+
LOG_FILE=/dev/null
function check_success {
function check_success {
Line 253:
Line 258:
}
}
−
echo -
en
"\033[01;
36m Restarting
Gunicorn
...
"
+
−
cat CHANGELOG.md
&> /
dev
/
null
+
git pull
+
cd /home/cpc/cpc
+
./post_pull.sh
+
+
echo -
e
"\033[01;
36mRestarting
Gunicorn
\033[01;00m"
+
sudo /usr/sbin/service gunicorn restart &> ${LOG_FILE}
+
check_success
+
+
echo -e "\033[01;36mRestarting Daphne\033[01;00m"
+
sudo /usr/sbin/service daphne restart &> ${LOG_FILE}
+
check_success
+
+
echo -e "\033[01;36mRestarting Celery\033[01;00m
"
+
sudo /usr/sbin/service celery restart
&>
${LOG_FILE}
+
check_success
+
+
echo -e "\033[01;36mRestarting CeleryBeat\033[01;00m"
+
sudo
/
usr
/
sbin/service celerybeat restart &> ${LOG_FILE}
check_success
check_success
</source>
</source>
Rafahsolis
Bureaucrats
,
Administrators
2,306
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version